XamlZealot
XamlZealot

Reputation: 722

Kentico 9: How to grant permission to built-in types (classes)?

So I have created a custom module that allows certain users to create cities and associate them to States (cms.state).

For the UI element, I used an Object Listing template where the Object Type is set to State (cms.state):

enter image description here enter image description here

This presents a list of US states as expected:

enter image description here

This only works as expected when logged in as Global Administrator. I need to be able to grant view permission to this page for a specific role, who certainly should not have Global Administration permissions. When a user who is only assigned to an EDITOR role views this page, they are told they do not have permission:

enter image description here

I have searched high and low through roles, permissions, users etc.....and I cannot find a way to grant view permissions to class cms.state. I have tried scripting a permission into the SQL database and creating a role permission for it, I have tried altering the cms.state record in the CMS_Class table (flagging ClassIsDocumentType, ClassShowAsSystemTable) and I cannot get it to show in any of the permission assignments.

Any guidance on this topic would be helpful. Thanks in advance!

EDIT: Capture of Globalization Module Permission Tab showing inability to customize permissions

enter image description here

Upvotes: 0

Views: 173

Answers (1)

Brenden Kehren
Brenden Kehren

Reputation: 6117

First make sure you have your permissions defined.

Also, I believe cms.state is a global Kentico reserved class name so you'd have to rename your class to have a different name. Unless you're reusing the existing class/object. If you are, you may need to modify the permissions within the Globalization module to be able to edit the state object(s).

** UPDATE ** Ok I see what you're doing now. I believe the Globalization module does not have Read/Modify permissions and you can't add them either. IMHO it's best to create your own country/state classes because Kentico has some weird setup with how they work and are linked. This will give you the flexiblity you need/want in order to allow your users what they need.

Upvotes: 0

Related Questions