private static bool Create(AuthorizeActionAttribute attribute, IFacetHolder holder) { bool added = false; if (attribute != null) { if (attribute.Roles != null || attribute.Users != null) { IFacet facet = new SecurityHideForSessionFacet(attribute.Roles, attribute.Users, holder); added = FacetUtils.AddFacet(facet); facet = new SecurityDisableForSessionFacet(attribute.Roles, attribute.Users, holder); added |= FacetUtils.AddFacet(facet); } } return added; }
private static bool Create(AuthorizePropertyAttribute attribute, IFacetHolder holder) { bool added = false; if (attribute != null) { if (attribute.ViewRoles != null || attribute.ViewUsers != null) { var facet = new SecurityHideForSessionFacet(attribute.ViewRoles, attribute.ViewUsers, holder); added = FacetUtils.AddFacet(facet); } if (attribute.EditRoles != null || attribute.EditUsers != null) { var facet = new SecurityDisableForSessionFacet(attribute.EditRoles, attribute.EditUsers, holder); added |= FacetUtils.AddFacet(facet); } } return added; }