예제 #1
0
        /// <summary>
        /// 是否允许创建操作
        /// </summary>
        /// <param name="operation">操作</param>
        public async Task <bool> CanCreateAsync(Operation operation)
        {
            var exists = await _store.ExistsAsync(x =>
                                                  x.Uri == operation.Code &&
                                                  x.Type == ResourceType.Operation &&
                                                  x.ApplicationId == operation.ApplicationId &&
                                                  x.ParentId == operation.ModuleId);

            return(exists == false);
        }
예제 #2
0
        /// <summary>
        /// 是否允许创建身份资源
        /// </summary>
        /// <param name="identityResource">身份资源</param>
        public async Task <bool> CanCreateAsync(IdentityResource identityResource)
        {
            var exists = await _store.ExistsAsync(t => t.Uri == identityResource.Uri && t.Type == ResourceType.Identity);

            return(exists == false);
        }
예제 #3
0
        /// <summary>
        /// 是否允许创建资源
        /// </summary>
        /// <param name="resource">资源</param>
        public async Task <bool> CanCreateAsync(ApiResource resource)
        {
            var exists = await _store.ExistsAsync(t => t.Uri == resource.Uri && t.Type == ResourceType.Api);

            return(exists == false);
        }