Set-ITGlueResourceAccess
SYNOPSIS
Update resource accesses for a particular resource
SYNTAX
__AllParameterSets
Set-ITGlueResourceAccess [-ResourceType] <string> [-ResourceId] <long> [-Data <Object>]
[-AccessorType <string>] [-AccessorId <long>] [-Raw] [-WhatIf] [-Confirm]
ALIASES
This cmdlet has the following aliases,
- None
DESCRIPTION
The Set-ITGlueResourceAccess cmdlet invokes the PATCH method of the /{resource_type}/{resource_id}/relationships/resource_accesses endpoint (Update resource accesses for a particular resource)
Edit user/group resource accesses to a resource. The “accessor-type” can be “User” or “Group”, depending on who is being granted access to the resource. The “accessor-id” is the id value for the “Group” or “User” being granted access.
All resource-accesses are replaced by the supplied payload, and any pre-existing resource-accesses not included by the new collection are deleted.
Returns the updated list of “resource accesses” for the resource and a 200 status code if successful.
Below is a sample request body with a JSON array to update a resource’s access.
{ “data”: [ { “type”: “resource-accesses”, “attributes”: { “accessor-id”: 2, “accessor-type”: “User” } }, { “type”: “resource-accesses”, “attributes”: { “accessor-id”: 1, “accessor-type”: “Group” } }, { “type”: “resource-accesses”, “attributes”: {…} } ] }
This is a write function. It changes data in ITGlue. Use -WhatIf to see the request without sending it
EXAMPLES
EXAMPLE 1
Set-ITGlueResourceAccess -ResourceType 'checklists' -ResourceId 12345 -Data @{} -WhatIf
Shows the PATCH request to the /{resource_type}/{resource_id}/relationships/resource_accesses endpoint without sending it
PARAMETERS
-AccessorId
The ID of the user or group whose access is changed
Sets the accessor-id attribute of the request body when -Data is not used
Type: System.Int64
DefaultValue: 0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-AccessorType
The type of the accessor whose access is changed
Sets the accessor-type attribute of the request body when -Data is not used
Allowed values: ‘User’, ‘Group’
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- cf
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Data
Defines the data of the JSON:API request body. Accepts a hashtable, an object, or a JSON string
The value is sent as the data property of the request body, such as @{ type = ‘organizations’; attributes = @{ name = ‘Example’ } }. An object with a single data property & a JSON string are sent as is
Body properties:
- type (string) - resource-accesses
- attributes (object):
- accessor_id (integer)
- accessor_type (string)
Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Raw
Returns the full API response (data, meta, links, & included) instead of only the data
Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-ResourceId
The resource id of the parent resource.
Type: System.Int64
DefaultValue: 0
SupportsWildcards: false
Aliases:
- resource_id
ParameterSets:
- Name: (All)
Position: 1
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-ResourceType
The resource type of the parent resource
Allowed values: ‘checklists’, ‘configurations’, ‘contacts’, ‘documents’, ‘document_folders’, ‘domains’, ‘locations’, ‘password_folders’, ‘passwords’, ‘ssl_certificates’, ‘flexible_assets’
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases:
- resource_type
ParameterSets:
- Name: (All)
Position: 0
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-WhatIf
Runs the command in a mode that only reports what would happen without performing the actions.
Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- wi
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
System.String
System.Int64
OUTPUTS
NOTES
Endpoint : PATCH /{resource_type}/{resource_id}/relationships/resource_accesses