コード例 #1
0
ファイル: FormRepository.cs プロジェクト: makhalaf/frapid
        public async Task <EntityView> GetMetaAsync()
        {
            if (string.IsNullOrWhiteSpace(this.Database))
            {
                return(null);
            }

            if (!this.SkipValidation)
            {
                if (!this.Validated)
                {
                    await this.ValidateAsync(AccessTypeEnum.Read, this.LoginId, this.Database, false).ConfigureAwait(false);
                }
                if (!this.HasAccess)
                {
                    Log.Information(
                        $"Access to view meta information on entity \"{this.FullyQualifiedObjectName}\" was denied to the user with Login ID {this.LoginId}");
                    throw new UnauthorizedException("Access is denied.");
                }
            }

            return
                (await
                 EntityView.GetAsync(this.Database, this.PrimaryKey, this._ObjectNamespace, this.GetTableName())
                 .ConfigureAwait(false));
        }