New PodeAccessScheme - mdaneri/Pode GitHub Wiki
Create a new type of Access scheme.
New-PodeAccessScheme -Type <String> [-Path <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
New-PodeAccessScheme -Type <String> [-ScriptBlock <ScriptBlock>] [-ArgumentList <Object[]>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
New-PodeAccessScheme [-Custom] -Path <String> [-ProgressAction <ActionPreference>] [<CommonParameters>]
New-PodeAccessScheme [-Custom] -ScriptBlock <ScriptBlock> [-ArgumentList <Object[]>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
Create a new type of Access scheme, which retrieves the destination/resource's authorisation values which a user needs for access.
$role_access = New-PodeAccessScheme -Type Role
$group_access = New-PodeAccessScheme -Type Group -Path 'Metadata.Groups'
$scope_access = New-PodeAccessScheme -Type Scope -Scriptblock { param($user) return @(Get-ExampleAccess -Username $user.Username) }
$custom_access = New-PodeAccessScheme -Custom -Path 'CustomProp'
An optional array of arguments to supply to the ScriptBlock.
Type: Object[]
Parameter Sets: Type_Scriptblock, Custom_Scriptblock
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseIf supplied, the access Scheme will be flagged as using Custom logic.
Type: SwitchParameter
Parameter Sets: Custom_Path, Custom_Scriptblock
Aliases:
Required: True
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseAn optional property Path within the $WebEvent.Auth.User object to extract authorisation values. The default Path is based on the Access Type, either Roles; Groups; Scopes; or Username. This, or ScriptBlock, is mandatory if using a Custom scheme.
Type: String
Parameter Sets: Type_Path
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseType: String
Parameter Sets: Custom_Path
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseAn optional ScriptBlock for retrieving authorisation values for the authenticated user, useful if the values reside in an external data store. This, or Path, is mandatory if using a Custom scheme.
Type: ScriptBlock
Parameter Sets: Type_Scriptblock
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseType: ScriptBlock
Parameter Sets: Custom_Scriptblock
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe inbuilt Type of Access this method is for: Role, Group, Scope, User.
Type: String
Parameter Sets: Type_Path, Type_Scriptblock
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.