Esempio n. 1
0
 private bool FilterByRoles(OperationInspector inspector, string[] expectedRoles, IEnumerable <string> actualRoles)
 {
     if (expectedRoles.Length == 0)
     {
         return(true);
     }
     return(inspector.CheckByRoles(expectedRoles, actualRoles));
 }
Esempio n. 2
0
 private static bool FilterByRolesAndPermissions(OperationInspector inspector, string[] roles, string[] permissions, Content content)
 {
     if (roles.Length > 0 && !inspector.CheckByRoles(roles))
     {
         return(false);
     }
     if (permissions.Length > 0 && !inspector.CheckByPermissions(content, permissions))
     {
         return(false);
     }
     return(true);
 }