Access Policies
  • 09 Oct 2024
  • 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] <EntityRef[]> 
    [-LiquitContext <LiquitContext>]  
    [<CommonParameters>]

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

Get-LiquitAccessPolicy 
    [-Name] <string> 
    [-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.

Parameters

NameValueDescriptionRequiredDefault value
Type<string[]>The type of access policy.
  • Role - you can grant predefined privileges to it.
  • Script - allows for greater control but requires scripting.
Search<string>This parameter serves a similar purpose to the search box found in the access policies table from the Liquit Workspace UI. It enables users to search multiple columns within the table, such as Name and Type. When a search term is provided, the parameter filters records by matching values in these indexed columns. However, it's important to note that not all columns in the table are indexed, meaning that searches for values in these non-indexed columns will not return results. Non-indexed columns include for example the ID and columns containing checkboxes.
Name<string>Searches on the access policy name itself.
LiquitContext<LiquitContext>Determines the selected zone.NoDefault

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 policy.Yes
Privileges<string[]>An array of privileges.If the Role option is not used.
ScriptContent<string>Provide a script for the access policy.If the Privileges option is not used.
Description<string>Describe the access policy.No
LiquitContext<LiquitContext>Determines the selected zone.NoDefault

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 policy.Yes
Privileges<string[]>An array of privileges.If the Script option is not used.
ScriptContent<string>Provide a script for the access policy.If the Privileges option is not used.
Description<string>Describe the access policy.No
LiquitContext<LiquitContext>Determines the selected zone.NoDefault

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 remove.Yes
LiquitContext<LiquitContext>Determines the selected zone.NoDefault

Was this article helpful?

What's Next