Access Policies
  • 18 Dec 2023
  • 2 Minutes to read
  • Dark
    Light
  • PDF

Access Policies

  • Dark
    Light
  • PDF

Article Summary

Get-LiquitAccessPolicy

Synopsis

This command displays a list of all access policies known within the Liquit Workspace or selects an access policy in particular.

Syntax

Get-LiquitAccessPolicy 
    [-LiquitContext <LiquitContext>]  
    [<CommonParameters>]

Get-LiquitAccessPolicy 
    [-ID] <guid[]> 
    [-LiquitContext <LiquitContext>]  
    [<CommonParameters>]

Get-LiquitAccessPolicy 
    [-Reference] <NamedEntityRef[]> 
    [-LiquitContext <LiquitContext>]  
    [<CommonParameters>]

Get-LiquitAccessPolicy 
    [-Type] {Script | Role} 
    [-LiquitContext <LiquitContext>]  
    [<CommonParameters>]

Examples

Example 1

Get-LiquitAccessPolicy 

This command displays all access policies known within the Liquit Workspace.

Example 2

Get-LiquitAccessPolicy -type Script

This command selects all "script" type access policies.

Example 3

Get-LiquitAccessPolicy -id 00000000-0000-0000-0000-000000000000

This command selects a specific access policy.

New-LiquitAccessPolicy

Synopsis

This command creates a new access policy.

Syntax

New-LiquitAccessPolicy 
    [-Name] <string> 
    [-Privileges <string[]> 
    [-Role] 
    [-Description <string>] 
    [-LiquitContext <LiquitContext>] 
    [-WhatIf] 
    [-Confirm]  
    [<CommonParameters>]

New-LiquitAccessPolicy 
    [-Name] <string> 
    [-Script]
    [-ScriptContent <string>]
    [-Description <string>] 
    [-LiquitContext <LiquitContext>] 
    [-WhatIf] 
    [-Confirm]  
    [<CommonParameters>]

Examples

Example 1

New-LiquitAccessPolicy -role -privileges @("package.view") -name "PowerShell Policy"

This command creates a new access policy with the name "PowerShell Policy".

See Privileges for a complete list of privileges.

Example 2

New-LiquitAccessPolicy -script -scriptcontent "(isof(resource, '# Liquit.Server.BLL.Content') and ((action eq 'create' or action eq 'createall')))" -name "PowerShell Policy"

Parameters

NameValueDescriptionRequiredDefault value
Name<string>Provide a name for the access policyYes
Privileges<string[]>An array of privilegesIf the Role option is not used
ScriptContent<string>Provide a script for the access policyIf the Privileges option is not used
Description<string>Describe the access policyNo
LiquitContext<LiquitContext>Determines the selected zoneNoDefault

Set-LiquitAccessPolicy

Synopsis

This command edits the properties of an access policy.

Syntax

Set-LiquitAccessPolicy 
    [-AccessPolicy] <AccessPolicy[]> 
    [-Name <string>] 
    [-Description <string>] 
    [-ScriptContent <string>] 
    [-Privileges <string[]>] 
    [-LiquitContext <LiquitContext>] 
    [-WhatIf] 
    [-Confirm]  
    [<CommonParameters>]

Example

$accesPolicy = Get-LiquitAccessPolicy -id 00000000-0000-0000-0000-000000000000
Set-LiquitAccessPolicy -AccessPolicy $accesPolicy -Name PowerShellPolicy

This command updates the name of the specified access policy to "PowerShellPolicy".

Parameters

NameValueDescriptionRequiredDefault value
Name<string>Provide a name for the access policyYes
Privileges<string[]>An array of privilegesIf the Script option is not used
ScriptContent<string>Provide a script for the access policyIf the Privileges option is not used
Description<string>Describe the access policyNo
LiquitContext<LiquitContext>Determines the selected zoneNoDefault

Remove-LiquitAccessPolicy

Synopsis

This command removes an access policy from the Liquit Workspace.

Syntax

Remove-LiquitAccessPolicy 
    [-AccessPolicy] <AccessPolicy[]> 
    [-LiquitContext <LiquitContext>] 
    [-WhatIf] 
    [-Confirm]  
    [<CommonParameters>]

Example

$AccessPolicy = Get-LiquitAccessPolicy -id 00000000-0000-0000-0000-000000000000
Remove-LiquitAccessPolicy -AccessPolicy $AccessPolicy

This command removes the selected access policy from the Liquit Workspace.

Parameters

NameValueDescriptionRequiredDefault value
AccessPolicy<AccessPolicy[]>The access policy you wish to removeYes
LiquitContext<LiquitContext>Determines the selected zoneNoDefault

Was this article helpful?

What's Next