예제 #1
0
        public PermissionValueCheckContext(
            [NotNull] PermissionDefinition permission, [CanBeNull] ClaimsPrincipal principal)
        {
            Check.NotNull(permission, nameof(permission));

            Permission = permission;
            Principal  = principal;
        }
예제 #2
0
        protected virtual void AddPermissionToDictionaryRecursively(
            Dictionary <string, PermissionDefinition> permissions,
            PermissionDefinition permission)
        {
            if (permissions.ContainsKey(permission.Name))
            {
                throw new RocketException("Duplicate permission name: " + permission.Name);
            }

            permissions[permission.Name] = permission;

            foreach (var child in permission.Children)
            {
                AddPermissionToDictionaryRecursively(permissions, child);
            }
        }