public HasUserDataAccess ( long userId, long entityId, long dataId, RightType rightType ) : bool | ||
userId | long | |
entityId | long | |
dataId | long | |
rightType | RightType | |
Результат | bool |
/// <summary> /// return true if user has edit rights /// </summary> /// <returns></returns> private bool hasUserEditRights(long entityId) { #region security permissions and authorisations check // set edit rigths PermissionManager permissionManager = new PermissionManager(); SubjectManager subjectManager = new SubjectManager(); Security.Services.Objects.TaskManager securityTaskManager = new Security.Services.Objects.TaskManager(); bool hasAuthenticationRigths = false; User user = subjectManager.GetUserByName(GetUsernameOrDefault()); long userid = -1; if (user != null) { userid = subjectManager.GetUserByName(GetUsernameOrDefault()).Id; hasAuthenticationRigths = permissionManager.HasUserDataAccess(userid, 1, entityId, RightType.Update); return (hasAuthenticationRigths); } else { return false; } #endregion }