public async Task GrantTargetApp(GatewayUser user, string appId) { if (!await HasAuthorizedApp(user, appId)) { var appGrant = new AppGrant { AppID = appId, GatewayUserId = user.Id }; _dbContext.LocalAppGrant.Add(appGrant); await _dbContext.SaveChangesAsync(); } }
internal static int Update(AppGrant info) { string sql = "update AppGrant set AppId=@AppId,AppServiceId=@AppServiceId,AppFunctionId=@AppFunctionId where AppGrantId=@AppGrantId"; return(Update <AppGrant>(con, sql, info)); }
internal static int Add(AppGrant info) { string sql = "insert into AppGrant(AppId,AppServiceId,AppFunctionId) values(@AppId,@AppServiceId,@AppFunctionId)"; return(Insert <AppGrant>(con, sql, info)); }