예제 #1
0
 private ApiScopeEvaluationResult EvaluateApiScope(IActionRequiringEntityPermissions <ActionOnNewPackageContext> action, ActionOnNewPackageContext context, params string[] requestedActions)
 {
     return(ApiScopeEvaluator.Evaluate(
                GetCurrentUser(),
                User.Identity.GetScopesFromClaim(),
                action,
                context,
                requestedActions));
 }
 private IReadOnlyCollection <ReservedNamespace> GetReservedNamespaces(ActionOnNewPackageContext newPackageContext)
 {
     return(newPackageContext.ReservedNamespaceService.GetReservedNamespacesForId(newPackageContext.PackageId));
 }
 public PermissionsCheckResult CheckPermissionsOnBehalfOfAnyAccount(User currentUser, ActionOnNewPackageContext newPackageContext)
 {
     return(CheckPermissionsOnBehalfOfAnyAccount(currentUser, GetReservedNamespaces(newPackageContext)));
 }
 public PermissionsCheckResult CheckPermissionsOnBehalfOfAnyAccount(User currentUser, ActionOnNewPackageContext newPackageContext, out IEnumerable <User> accountsAllowedOnBehalfOf)
 {
     return(CheckPermissionsOnBehalfOfAnyAccount(currentUser, GetReservedNamespaces(newPackageContext), out accountsAllowedOnBehalfOf));
 }
 public PermissionsCheckResult CheckPermissions(IPrincipal currentPrincipal, User account, ActionOnNewPackageContext newPackageContext)
 {
     return(CheckPermissions(currentPrincipal, account, GetReservedNamespaces(newPackageContext)));
 }