Check if user is a site admin in share side webscript

cancel
Showing results for 
Search instead for 
Did you mean: 
Pravesh
Active Member

Check if user is a site admin in share side webscript

Jump to solution

How to check if user is a site admin in share side webscript? I need this so admins are able to view certain features.

1 Solution

Accepted Solutions
Pravesh
Active Member

Re: Check if user is a site admin in share side webscript

Jump to solution

Is there something that can be used in a ftl file to compare or check for Site Manager permisssion? Likke we can put the outcome of this query in model (e.g model.isAdminQuery = ??? ) and check it in ftl


@kaynezhang wrote:

Try

if (user.properties["alfUserGroups"].indexOf("GROUP_SITE_ADMINISTRATORS") != -1)
{
	//do something
}

 

View solution in original post

3 Replies
kaynezhang
Advanced

Re: Check if user is a site admin in share side webscript

Jump to solution

Try

if (user.properties["alfUserGroups"].indexOf("GROUP_SITE_ADMINISTRATORS") != -1)
{
	//do something
}
Pravesh
Active Member

Re: Check if user is a site admin in share side webscript

Jump to solution

Is there something that can be used in a ftl file to compare or check for Site Manager permisssion? Likke we can put the outcome of this query in model (e.g model.isAdminQuery = ??? ) and check it in ftl


@kaynezhang wrote:

Try

if (user.properties["alfUserGroups"].indexOf("GROUP_SITE_ADMINISTRATORS") != -1)
{
	//do something
}

 

kaynezhang
Advanced

Re: Check if user is a site admin in share side webscript

Jump to solution

I'm sorry I haven't use it in FTL before ,But I thinke you can extend the webscript backend js and put the result of group membership into the returned model, And then use it in ftl