Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for permissions on Pages & Posts #1025

Closed
tidyui opened this issue Feb 3, 2020 · 1 comment
Closed

Add support for permissions on Pages & Posts #1025

tidyui opened this issue Feb 3, 2020 · 1 comment

Comments

@tidyui
Copy link
Member

tidyui commented Feb 3, 2020

Add built-in support for specifying permissions for accessing pages & posts through the front-end application. The basic policy authentication in ASP.NET will be used (i.e the same that is used by the manager interface).

@tidyui tidyui added this to the Version 8.1 milestone Feb 3, 2020
@tidyui tidyui added this to To do in Version 8.1 via automation Feb 3, 2020
@tidyui
Copy link
Member Author

tidyui commented Feb 3, 2020

Suggested implementation. A new property will be added to PermissionItem so that internal permissions can be distinguished from application permissions. These are added in the startup:

App.Permissions["Application"].Add(new Piranha.Security.PermissionItem
{
    Name = "Subscriber",
    Title = "Subscriber"
});
App.Permissions["Application"].Add(new Piranha.Security.PermissionItem
{
    Name = "Moderator",
    Title = "Moderator"
});

Please note that the name "Application" can be any name you'd like to use for grouping in the role management. These permissions can then be access when building roles in the manager:

Permissions that should only be used in the manager should be added as internal:

App.Permissions["Manager"].Add(new Piranha.Security.PermissionItem
{
    Category = "My category",
    Name = "Moderator",
    Title = "Moderator",
    IsInternal = true
});

Skärmavbild 2020-02-03 kl  15 23 44

When editing a page or post, the permissions which are not set as internal will be available on the settings modal.

Skärmavbild 2020-02-03 kl  15 21 01

@tidyui tidyui moved this from To do to In progress in Version 8.1 Feb 3, 2020
@tidyui tidyui self-assigned this Feb 3, 2020
@tidyui tidyui closed this as completed in 06a817d Feb 4, 2020
Version 8.1 automation moved this from In progress to Done Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Version 8.1
  
Done
Development

No branches or pull requests

1 participant