/// <summary>
        /// Utility method to validate security access for a given right on Employee records
        /// </summary>
        /// <param name="recordRight">The right for which to validate access</param>
        bool HasAccess(RecordRight recordRight)
        {
            //Look up security information by SecureObject->UniqueName => "EmployeeRecords" for the CurrentUser
            SecureObject employeeSecurity = (SecureObject)_suplexDal.EvalSecureObjectSecurity("EmployeeRecords", CurrentUser);

            //Assess AccessAllowed
            return(employeeSecurity?.Security.Results.GetByTypeRight(recordRight).AccessAllowed ?? false);
        }
Exemplo n.º 2
0
 public ISecureObject EvalSecureObjectSecurity(string uniqueName, string userName, IEnumerable <string> externalGroupMembership)
 {
     if (Guid.TryParse(uniqueName, out Guid secureObjectUId) && Guid.TryParse(userName, out Guid userUId))
     {
         return(_dal.EvalSecureObjectSecurity(secureObjectUId, userUId, externalGroupMembership));
     }
     else
     {
         return(_dal.EvalSecureObjectSecurity(uniqueName, userName, externalGroupMembership));
     }
 }