Skip to main content
added 214 characters in body
Source Link
Michael West
  • 18.6k
  • 2
  • 42
  • 105

Delegated Administration with SPE

Let's say for example that you wanted to provide a Context Menu option for users to unlock items based on the following criteria.

  • Show when User is in the sitecore\Delegated Admin role
  • Enable when the item is locked

In between cooking eggs at home I was able to whip this up.

Unlock Elevated Context Menu

So here is how I built it.

  1. Create a new SPE Module with a Context Menu library.
  2. Create a new script for unlocking the selected item.
  3. Configure a rule for Show and Enable when certain conditions are met.

Script with Rules

Now the user is able to Lock and Edit.

Lock and Edit

Sample script for Unlock Elevated:

$item = Get-Item -Path .
# The user should be one granted the appropriate access.
$user = Get-User -Id "superuser"
New-UsingBlock (New-Object Sitecore.Security.Accounts.UserSwitcher $user) {
    $item | Unlock-Item
}

Note: This solution may be better suited as a Ribbon command. You can read more about how to do that here.

Unlock Elevated Ribbon


Turns out Richard Seal apparently had the same idea today and hosted this.

Delegated Administration with SPE

Let's say for example that you wanted to provide a Context Menu option for users to unlock items based on the following criteria.

  • Show when User is in the sitecore\Delegated Admin role
  • Enable when the item is locked

In between cooking eggs at home I was able to whip this up.

Unlock Elevated Context Menu

So here is how I built it.

  1. Create a new SPE Module with a Context Menu library.
  2. Create a new script for unlocking the selected item.
  3. Configure a rule for Show and Enable when certain conditions are met.

Script with Rules

Now the user is able to Lock and Edit.

Lock and Edit

Sample script for Unlock Elevated:

$item = Get-Item -Path .
# The user should be one granted the appropriate access.
$user = Get-User -Id "superuser"
New-UsingBlock (New-Object Sitecore.Security.Accounts.UserSwitcher $user) {
    $item | Unlock-Item
}

Note: This solution may be better suited as a Ribbon command. You can read more about how to do that here.

Unlock Elevated Ribbon

Delegated Administration with SPE

Let's say for example that you wanted to provide a Context Menu option for users to unlock items based on the following criteria.

  • Show when User is in the sitecore\Delegated Admin role
  • Enable when the item is locked

In between cooking eggs at home I was able to whip this up.

Unlock Elevated Context Menu

So here is how I built it.

  1. Create a new SPE Module with a Context Menu library.
  2. Create a new script for unlocking the selected item.
  3. Configure a rule for Show and Enable when certain conditions are met.

Script with Rules

Now the user is able to Lock and Edit.

Lock and Edit

Sample script for Unlock Elevated:

$item = Get-Item -Path .
# The user should be one granted the appropriate access.
$user = Get-User -Id "superuser"
New-UsingBlock (New-Object Sitecore.Security.Accounts.UserSwitcher $user) {
    $item | Unlock-Item
}

Note: This solution may be better suited as a Ribbon command. You can read more about how to do that here.

Unlock Elevated Ribbon


Turns out Richard Seal apparently had the same idea today and hosted this.

added 94 characters in body
Source Link
Michael West
  • 18.6k
  • 2
  • 42
  • 105

Delegated Administration with SPE

Let's say for example that you wanted to provide a Context Menu option for users to unlock items based on the following criteria.

  • Show when User is in the sitecore\Delegated Admin role
  • Enable when the item is locked

In between cooking eggs at home I was able to whip this up.

Unlock ElevatedUnlock Elevated Context Menu

So here is how I built it.

  1. Create a new SPE Module with a Context Menu library.
  2. Create a new script for unlocking the selected item.
  3. Configure a rule for Show and Enable when certain conditions are met.

Script with Rules

Now the user is able to Lock and Edit.

Lock and Edit

Sample script for Unlock Elevated:

$item = Get-Item -Path .
# The user should be one granted the appropriate access.
$user = Get-User -Id "superuser"
New-UsingBlock (New-Object Sitecore.Security.Accounts.UserSwitcher $user) {
    $item | Unlock-Item
}

Note: This solution may be better suited as a Ribbon command. You can read more about how to do that here.

Unlock Elevated Ribbon

Delegated Administration with SPE

Let's say for example that you wanted to provide a Context Menu option for users to unlock items based on the following criteria.

  • Show when User is in the sitecore\Delegated Admin role
  • Enable when the item is locked

In between cooking eggs at home I was able to whip this up.

Unlock Elevated

So here is how I built it.

  1. Create a new SPE Module with a Context Menu library.
  2. Create a new script for unlocking the selected item.
  3. Configure a rule for Show and Enable when certain conditions are met.

Script with Rules

Now the user is able to Lock and Edit.

Lock and Edit

Sample script for Unlock Elevated:

$item = Get-Item -Path .
# The user should be one granted the appropriate access.
$user = Get-User -Id "superuser"
New-UsingBlock (New-Object Sitecore.Security.Accounts.UserSwitcher $user) {
    $item | Unlock-Item
}

Note: This solution may be better suited as a Ribbon command. You can read more about how to do that here.

Delegated Administration with SPE

Let's say for example that you wanted to provide a Context Menu option for users to unlock items based on the following criteria.

  • Show when User is in the sitecore\Delegated Admin role
  • Enable when the item is locked

In between cooking eggs at home I was able to whip this up.

Unlock Elevated Context Menu

So here is how I built it.

  1. Create a new SPE Module with a Context Menu library.
  2. Create a new script for unlocking the selected item.
  3. Configure a rule for Show and Enable when certain conditions are met.

Script with Rules

Now the user is able to Lock and Edit.

Lock and Edit

Sample script for Unlock Elevated:

$item = Get-Item -Path .
# The user should be one granted the appropriate access.
$user = Get-User -Id "superuser"
New-UsingBlock (New-Object Sitecore.Security.Accounts.UserSwitcher $user) {
    $item | Unlock-Item
}

Note: This solution may be better suited as a Ribbon command. You can read more about how to do that here.

Unlock Elevated Ribbon

added 57 characters in body
Source Link
Michael West
  • 18.6k
  • 2
  • 42
  • 105

Delegated Administration with SPE

Let's say for example that you wanted to provide a Context Menu option for users to unlock items based on the following criteria.

  • Show when User is in the sitecore\Delegated Admin role
  • Enable when the item is locked

In between cooking eggs at home I was able to whip this up.

Unlock Elevated

So here is how I built it.

So here is how I built it.

  1. Create a new SPE Module with a Context Menu library.
  2. Create a new script for unlocking the selected item.
  3. Configure a rule for Show and Enable when certain conditions are met.

Script with Rules

Now the user is able to Lock and Edit.

Lock and Edit

Sample script for Unlock Elevated:

$item = Get-Item -Path .
# The user should be one granted the appropriate access.
$user = Get-User -Id "superuser"
New-UsingBlock (New-Object Sitecore.Security.Accounts.UserSwitcher $user) {
    $item | Unlock-Item
}

ThisNote: This solution may be better suited as a Ribbon command. You can read more about how to do that here.

Let's say for example that you wanted to provide a Context Menu option for users to unlock items based on the following criteria.

  • Show when User is in the sitecore\Delegated Admin role
  • Enable when the item is locked

In between cooking eggs at home I was able to whip this up.

Unlock Elevated

So here is how I built it.

  1. Create a new SPE Module with a Context Menu library.
  2. Create a new script for unlocking the selected item.
  3. Configure a rule for Show and Enable when certain conditions are met.

Script with Rules

Now the user is able to Lock and Edit.

Lock and Edit

Sample script for Unlock Elevated:

$item = Get-Item -Path .
# The user should be one granted the appropriate access.
$user = Get-User -Id "superuser"
New-UsingBlock (New-Object Sitecore.Security.Accounts.UserSwitcher $user) {
    $item | Unlock-Item
}

This solution may be better suited as a Ribbon command. You can read more about how to do that here.

Delegated Administration with SPE

Let's say for example that you wanted to provide a Context Menu option for users to unlock items based on the following criteria.

  • Show when User is in the sitecore\Delegated Admin role
  • Enable when the item is locked

In between cooking eggs at home I was able to whip this up.

Unlock Elevated

So here is how I built it.

  1. Create a new SPE Module with a Context Menu library.
  2. Create a new script for unlocking the selected item.
  3. Configure a rule for Show and Enable when certain conditions are met.

Script with Rules

Now the user is able to Lock and Edit.

Lock and Edit

Sample script for Unlock Elevated:

$item = Get-Item -Path .
# The user should be one granted the appropriate access.
$user = Get-User -Id "superuser"
New-UsingBlock (New-Object Sitecore.Security.Accounts.UserSwitcher $user) {
    $item | Unlock-Item
}

Note: This solution may be better suited as a Ribbon command. You can read more about how to do that here.

Source Link
Michael West
  • 18.6k
  • 2
  • 42
  • 105
Loading