Example #1
0
        public static string DeleteSql(string applicationName, string resource, ServiceTypes serviceType)
        {
            var apiScopeName = GetApiScopeName(applicationName, serviceType);

            var claim = ClaimsHelper.ToClaim(
                PermissionSeeder.ToApplicationName(applicationName),
                PermissionSeeder.ToResourceName(resource), false, false, false, false);

            return($"DELETE FROM [dbo].[ApiScopeClaims] WHERE [ApiScopeId] = (SELECT Id FROM [dbo].[ApiScopes] WHERE Name='{apiScopeName}') AND [Type] = '{claim.Type}'");
        }
Example #2
0
        public static string InsertSql(string applicationName, string resource, ServiceTypes serviceType)
        {
            var apiScopeName = GetApiScopeName(applicationName, serviceType);

            var claim = ClaimsHelper.ToClaim(
                PermissionSeeder.ToApplicationName(applicationName),
                PermissionSeeder.ToResourceName(resource), false, false, false, false);

            return($"INSERT INTO [dbo].[ApiScopeClaims]([ApiScopeId],[Type]) VALUES((SELECT Id FROM [dbo].[ApiScopes] WHERE Name='{apiScopeName}'),'{claim.Type}')");
        }