Example #1
0
        public override bool CanAccess(IEdmEntityType edmEntityType)
        {
            AuthorizedRolesAnnotation authorizedRoles = GetAuthorizedRolesAnnotation(edmEntityType);

            return(IsAuthorized(authorizedRoles));
        }
Example #2
0
 private bool IsAuthorized(AuthorizedRolesAnnotation authorizedRoles)
 {
     return(authorizedRoles == null ||
            authorizedRoles.AllowedRoles.Any(role => role == "*" ||
                                             _principal.IsInRole(role)));
 }
 private bool IsAuthorized(AuthorizedRolesAnnotation authorizedRoles)
 {
     return authorizedRoles == null ||
            authorizedRoles.AllowedRoles.Any(role => role == "*" ||
                _principal.IsInRole(role));
 }