Click or drag to resize

IUserHasAdminRightToEdit Method (IUser)

Indicates if the current user has the administrative privileges to edit the specified user.

Namespace:  AskiaPortalCmn
Assembly:  AskiaPortalCmn (in AskiaPortalCmn.dll) Version: 1.7.0-build068
Syntax
bool HasAdminRightToEdit(
	IUser user
)

Parameters

user
Type: AskiaPortalCmnIUser
User to test

Return Value

Type: Boolean
Returns true if the current user is able to modify everything of the specified user.
Remarks
This method only check administrative privileges. It follows the below rules:

RuleuserAuserBuserA.HasAdminRightToEdit(userB);
A user cannot edit himself.
(even if it's a super-admin)
Id = 5
IsSuperAdmin = true
Id = 5
IsSuperAdmin = true
False
A super-admin is allowed to edit everybody.
(even another super-admin, except the root user)
Id = 5
IsSuperAdmin = true
Id = 6
IsSuperAdmin = true
True
A super-admin is not allowed to edit the root user.Id = 5
IsSuperAdmin = true
Id = 1 (root user)
IsSuperAdmin = true
False
A super-admin cannot be edited by a non super-admin.Id = 5
IsSuperAdmin = false
Permissions { "users" : "FullControl"}
ManagedGroups {1, 2, 3}
Id = 6
IsSuperAdmin = true
GroupId = 3
False
A user that doesn't have permission to edit user.Id = 5
IsSuperAdmin = false
Permissions { "users" : "ReadOnly"}
ManagedGroups {1, 2, 3}
Id = 6
IsSuperAdmin = false
GroupId = 3
False
A user that have permission to edit user,
but not to manage the group of the tested user
Id = 5
IsSuperAdmin = false
Permissions { "users" : "FullControl"}
ManagedGroups {1, 2}
Id = 6
IsSuperAdmin = false
GroupId = 3
False
A user that have permission to edit user,
and to manage the group of the tested user
Id = 5
IsSuperAdmin = false
Permissions { "users" : "FullControl"}
ManagedGroups {1, 2, 3}
Id = 6
IsSuperAdmin = false
GroupId = 3
True

Remarks

A user is never allowed to modify his own administrative privilege.

A super-admin can only be edited by another super-admin.

See Also