Skip to main content
added 15 characters in body
Source Link
Bart Koopman
  • 29.6k
  • 3
  • 40
  • 90

You do this in the _isAvailable method you implemented in your command Javascript, optionally you can also do this in the _isEnabled method.

In there you will have to check what Group the User belongs to. To get the current User and its Groups you can use the following:

var settings = Tridion.UI.UserSettings.getJsonUserSettings(true);
if (settings)
{
    var groups = settings.User.Data.GroupMemberships;
}

Now the groups parameter will be be an object array containing the Groups the current User belongs to, they are formatted as JSON with a type, title and href (the TCMURI).

Now please note that Administrator users are usually not assigned to any Groups specifically (because they have all rights coming from their Administrator status already). Such a user will also not have an array of Groups in its GroupMemberships, but that will just contain one object (being thethe Group "Everyone" for an Administrator).

To identify if a user is an Administrator, you can check out settings.User.Data.Privileges, that will have the value 1 (for an Administrator).

You do this in the _isAvailable method you implemented in your command Javascript, optionally you can also do this in the _isEnabled method.

In there you will have to check what Group the User belongs to. To get the current User and its Groups you can use the following:

var settings = Tridion.UI.UserSettings.getJsonUserSettings(true);
if (settings)
{
    var groups = settings.User.Data.GroupMemberships;
}

Now the groups parameter will be be an object array containing the Groups the current User belongs to, they are formatted as JSON with a type, title and href (the TCMURI).

Now please note that Administrator users are usually not assigned to any Groups specifically (because they have all rights coming from their Administrator status already). Such a user will also not have an array of Groups in its GroupMemberships, but that will just contain one object (being the Group "Everyone").

To identify if a user is an Administrator, you can check out settings.User.Data.Privileges, that will have the value 1 (for an Administrator).

You do this in the _isAvailable method you implemented in your command Javascript, optionally you can also do this in the _isEnabled method.

In there you will have to check what Group the User belongs to. To get the current User and its Groups you can use the following:

var settings = Tridion.UI.UserSettings.getJsonUserSettings(true);
if (settings)
{
    var groups = settings.User.Data.GroupMemberships;
}

Now the groups parameter will be be an object array containing the Groups the current User belongs to, they are formatted as JSON with a type, title and href (the TCMURI).

Now please note that Administrator users are usually not assigned to any Groups specifically (because they have all rights coming from their Administrator status already). Such a user will also not have an array of Groups in its GroupMemberships, but that will just contain one object (the Group "Everyone" for an Administrator).

To identify if a user is an Administrator, you can check out settings.User.Data.Privileges, that will have the value 1 (for an Administrator).

added info on how to identify Administrators
Source Link
Bart Koopman
  • 29.6k
  • 3
  • 40
  • 90

You do this in the _isAvailable method you implemented in your command Javascript, optionally you can also do this in the _isEnabled method.

In there you will have to check what Group the User belongs to. To get the current User and its Groups you can use the following:

var settings = Tridion.UI.UserSettings.getJsonUserSettings(true);
if (settings)
{
    var groups = settings.User.Data.GroupMemberships;
}

Now the groups parameter will be be an object array containing the Groups the current User belongs to, they are formatted as JSON with a type, title and href (the TCMURI).

Now please note that Administrator users are usually not assigned to any Groups specifically (because they have all rights coming from their Administrator status already). Such a user will also not have an array of Groups in its GroupMemberships, but that will just contain one object (being the Group "Everyone").

To identify if a user is an Administrator, you can check out settings.User.Data.Privileges, that will have the value 1 (for an Administrator).

You do this in the _isAvailable method you implemented in your command Javascript, optionally you can also do this in the _isEnabled method.

In there you will have to check what Group the User belongs to. To get the current User and its Groups you can use the following:

var settings = Tridion.UI.UserSettings.getJsonUserSettings(true);
if (settings)
{
    var groups = settings.User.Data.GroupMemberships;
}

Now the groups parameter will be be an object array containing the Groups the current User belongs to, they are formatted as JSON with a type, title and href (the TCMURI).

You do this in the _isAvailable method you implemented in your command Javascript, optionally you can also do this in the _isEnabled method.

In there you will have to check what Group the User belongs to. To get the current User and its Groups you can use the following:

var settings = Tridion.UI.UserSettings.getJsonUserSettings(true);
if (settings)
{
    var groups = settings.User.Data.GroupMemberships;
}

Now the groups parameter will be be an object array containing the Groups the current User belongs to, they are formatted as JSON with a type, title and href (the TCMURI).

Now please note that Administrator users are usually not assigned to any Groups specifically (because they have all rights coming from their Administrator status already). Such a user will also not have an array of Groups in its GroupMemberships, but that will just contain one object (being the Group "Everyone").

To identify if a user is an Administrator, you can check out settings.User.Data.Privileges, that will have the value 1 (for an Administrator).

deleted 1 characters in body
Source Link
Bart Koopman
  • 29.6k
  • 3
  • 40
  • 90

You do this in the _isAvailable method you implemented in your command Javascript, optionally you can also do this in the _isEnabled method.

In there you will have to check what Group the User belongs to. To get the current uUserUser and its Groups you can use the following:

var settings = Tridion.UI.UserSettings.getJsonUserSettings(true);
if (settings)
{
    var groups = settings.User.Data.GroupMemberships;
}

Now the groups parameter will be be an object array containing the Groups the current User belongs to, they are formatted as JSON with a type, title and href (the TCMURI).

You do this in the _isAvailable method you implemented in your command Javascript, optionally you can also do this in the _isEnabled method.

In there you will have to check what Group the User belongs to. To get the current uUser and its Groups you can use the following:

var settings = Tridion.UI.UserSettings.getJsonUserSettings(true);
if (settings)
{
    var groups = settings.User.Data.GroupMemberships;
}

Now the groups parameter will be be an object array containing the Groups the current User belongs to, they are formatted as JSON with a type, title and href (the TCMURI).

You do this in the _isAvailable method you implemented in your command Javascript, optionally you can also do this in the _isEnabled method.

In there you will have to check what Group the User belongs to. To get the current User and its Groups you can use the following:

var settings = Tridion.UI.UserSettings.getJsonUserSettings(true);
if (settings)
{
    var groups = settings.User.Data.GroupMemberships;
}

Now the groups parameter will be be an object array containing the Groups the current User belongs to, they are formatted as JSON with a type, title and href (the TCMURI).

added 1 characters in body
Source Link
Bart Koopman
  • 29.6k
  • 3
  • 40
  • 90
Loading
Source Link
Bart Koopman
  • 29.6k
  • 3
  • 40
  • 90
Loading