Browse Source

Use GetPublicConstantsRecursively in Permissions.GetAll.

pull/1059/head
maliming 8 years ago
parent
commit
bb8edb70fd
  1. 26
      modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/BloggingPermissions.cs
  2. 13
      modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/DocsAdminPermissions.cs
  3. 20
      modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityPermissions.cs
  4. 15
      modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/TenantManagementPermissions.cs
  5. 3
      samples/BookStore/src/Acme.BookStore.Application/Permissions/BookStorePermissions.cs
  6. 13
      samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/ProductManagement/ProductManagementPermissions.cs
  7. 9
      templates/module/src/MyCompanyName.MyProjectName.Application.Contracts/MyCompanyName/MyProjectName/MyProjectNamePermissions.cs
  8. 3
      templates/mvc/src/MyCompanyName.MyProjectName.Application/Permissions/MyProjectNamePermissions.cs
  9. 9
      templates/service/src/MyCompanyName.MyProjectName.Application.Contracts/MyCompanyName/MyProjectName/MyProjectNamePermissions.cs

26
modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/BloggingPermissions.cs

@ -1,4 +1,6 @@
namespace Volo.Blogging using Volo.Abp.Reflection;
namespace Volo.Blogging
{ {
public class BloggingPermissions public class BloggingPermissions
{ {
@ -39,27 +41,7 @@
public static string[] GetAll() public static string[] GetAll()
{ {
return new[] return ReflectionHelper.GetPublicConstantsRecursively(typeof(BloggingPermissions));
{
GroupName,
Blogs.Default,
Blogs.Management,
Blogs.Delete,
Blogs.Update,
Blogs.Create,
Posts.Default,
Posts.Delete,
Posts.Update,
Posts.Create,
Tags.Default,
Tags.Delete,
Tags.Update,
Tags.Create,
Comments.Default,
Comments.Delete,
Comments.Update,
Comments.Create
};
} }
} }
} }

13
modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/DocsAdminPermissions.cs

@ -1,4 +1,6 @@
namespace Volo.Docs.Admin using Volo.Abp.Reflection;
namespace Volo.Docs.Admin
{ {
public class DocsAdminPermissions public class DocsAdminPermissions
{ {
@ -14,14 +16,7 @@
public static string[] GetAll() public static string[] GetAll()
{ {
return new[] return ReflectionHelper.GetPublicConstantsRecursively(typeof(DocsAdminPermissions));
{
GroupName,
Projects.Default,
Projects.Delete,
Projects.Update,
Projects.Create,
};
} }
} }
} }

20
modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityPermissions.cs

@ -1,4 +1,6 @@
namespace Volo.Abp.Identity using Volo.Abp.Reflection;
namespace Volo.Abp.Identity
{ {
public static class IdentityPermissions public static class IdentityPermissions
{ {
@ -29,21 +31,7 @@
public static string[] GetAll() public static string[] GetAll()
{ {
return new[] return ReflectionHelper.GetPublicConstantsRecursively(typeof(IdentityPermissions));
{
GroupName,
Roles.Default,
Roles.Create,
Roles.Update,
Roles.Delete,
Roles.ManagePermissions,
Users.Default,
Users.Create,
Users.Update,
Users.Delete,
Users.ManagePermissions,
UserLookup.Default
};
} }
} }
} }

15
modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/TenantManagementPermissions.cs

@ -1,4 +1,6 @@
namespace Volo.Abp.TenantManagement using Volo.Abp.Reflection;
namespace Volo.Abp.TenantManagement
{ {
public static class TenantManagementPermissions public static class TenantManagementPermissions
{ {
@ -16,16 +18,7 @@
public static string[] GetAll() public static string[] GetAll()
{ {
return new[] return ReflectionHelper.GetPublicConstantsRecursively(typeof(TenantManagementPermissions));
{
GroupName,
Tenants.Default,
Tenants.Create,
Tenants.Update,
Tenants.Delete,
Tenants.ManageFeatures,
Tenants.ManageConnectionStrings
};
} }
} }
} }

3
samples/BookStore/src/Acme.BookStore.Application/Permissions/BookStorePermissions.cs

@ -1,4 +1,5 @@
using System; using System;
using Volo.Abp.Reflection;
namespace Acme.BookStore.Permissions namespace Acme.BookStore.Permissions
{ {
@ -12,7 +13,7 @@ namespace Acme.BookStore.Permissions
public static string[] GetAll() public static string[] GetAll()
{ {
//Return an array of all permissions //Return an array of all permissions
return Array.Empty<string>(); return ReflectionHelper.GetPublicConstantsRecursively(typeof(BookStorePermissions));
} }
} }
} }

13
samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/ProductManagement/ProductManagementPermissions.cs

@ -1,4 +1,6 @@
namespace ProductManagement using Volo.Abp.Reflection;
namespace ProductManagement
{ {
public class ProductManagementPermissions public class ProductManagementPermissions
{ {
@ -14,14 +16,7 @@
} }
public static string[] GetAll() public static string[] GetAll()
{ {
return new[] return ReflectionHelper.GetPublicConstantsRecursively(typeof(ProductManagementPermissions));
{
GroupName,
Products.Default,
Products.Delete,
Products.Update,
Products.Create
};
} }
} }
} }

9
templates/module/src/MyCompanyName.MyProjectName.Application.Contracts/MyCompanyName/MyProjectName/MyProjectNamePermissions.cs

@ -1,4 +1,6 @@
namespace MyCompanyName.MyProjectName using Volo.Abp.Reflection;
namespace MyCompanyName.MyProjectName
{ {
public class MyProjectNamePermissions public class MyProjectNamePermissions
{ {
@ -6,10 +8,7 @@
public static string[] GetAll() public static string[] GetAll()
{ {
return new[] return ReflectionHelper.GetPublicConstantsRecursively(typeof(MyProjectNamePermissions));
{
GroupName
};
} }
} }
} }

3
templates/mvc/src/MyCompanyName.MyProjectName.Application/Permissions/MyProjectNamePermissions.cs

@ -1,4 +1,5 @@
using System; using System;
using Volo.Abp.Reflection;
namespace MyCompanyName.MyProjectName.Permissions namespace MyCompanyName.MyProjectName.Permissions
{ {
@ -12,7 +13,7 @@ namespace MyCompanyName.MyProjectName.Permissions
public static string[] GetAll() public static string[] GetAll()
{ {
//Return an array of all permissions //Return an array of all permissions
return Array.Empty<string>(); return ReflectionHelper.GetPublicConstantsRecursively(typeof(MyProjectNamePermissions));
} }
} }
} }

9
templates/service/src/MyCompanyName.MyProjectName.Application.Contracts/MyCompanyName/MyProjectName/MyProjectNamePermissions.cs

@ -1,4 +1,6 @@
namespace MyCompanyName.MyProjectName using Volo.Abp.Reflection;
namespace MyCompanyName.MyProjectName
{ {
public class MyProjectNamePermissions public class MyProjectNamePermissions
{ {
@ -6,10 +8,7 @@
public static string[] GetAll() public static string[] GetAll()
{ {
return new[] return ReflectionHelper.GetPublicConstantsRecursively(typeof(MyProjectNamePermissions));
{
GroupName
};
} }
} }
} }
Loading…
Cancel
Save