Permissions for Globalization so countries can be accessed via REST

Laura Frese asked on January 12, 2017 18:51

I am using REST to access information on countries and states in a Kentico 10 website. I created a role and set permissions for that role. I assigned that role to the user making the rest requests. I added cms.country;cms.state to the REST allowed object types. However, in the permissions app in Kentico, there is no selection for Globalization so I cant create the permissions to allow that user to access the country and state data. I have to log in as admin to access that info. Any insights?

Recent Answers


Trevor Fayas answered on January 12, 2017 19:25

You'll have to experiment with the user type. Administrators have access to non-global resources, Editors to Site resources (once permissions given), global administrators have access to everything.

They may need to be an Administrator to even be allowed to look at non-site specific resources...

1 votesVote for this answer Mark as a Correct answer

Roman Hutnyk answered on January 13, 2017 15:15 (last edited on January 13, 2017 16:16)

What about overriding security with AuthorizeClass security event handler?

1 votesVote for this answer Mark as a Correct answer

Laura Frese answered on January 13, 2017 18:25

Those are both good ideas. I wrote kentico support and the response was "The classes from the Globalization (ie cms.country, cms.state) module are only accessible for Global administrators and there is no way to allow access for other users. If you need to access these objects using REST, the user must have the Global administrator privilege."

and "If you really need to access this data from a non-global admin and you'd like to look into other coding possibilities, another great way to do this is with global event handlers: https://docs.kentico.com/k10/custom-development/handling-global-events/reference-global-system-events. You can create a handler that triggers on the RequestEvents.PostAuthorize.Execute event and runs some code if the requested URL matches a certain schema (ie- http://mysite.com/custom/getcustomtabledata). I recently built a custom module that uses this approach to provide data (securely) at specific URLs, and it works great."

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.