BExIS.Web.Shell.Areas.DCM.Controllers.FormController.hasUserEditRights C# (CSharp) Method

hasUserEditRights() private method

return true if user has edit rights
private hasUserEditRights ( long entityId ) : bool
entityId long
return bool
        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
        }