Setting permissions
Please help me to set permissions for different roles created in sitefinity? I logged in as admin and tried to add permissions for the new roles. But the assigned permissions are not accessile when I logged as a user in corresponding role. Why its like this? For accessing assigned permissions for new roles what should I do? (All these have to do without any code level modification)
Im a starter in sitefinity. Please help me. Im using 5.1 version
Hello,
Thank you for contacting our Support Center.
As an administrator you have full control over the roles and their permissions. You can change them in the backend of Sitefinity under Administration -> Roles. For more information you may want to refer to this article and its subsections from our documentation. For your convenience I have also recorded a short video illustrating the setting of permissions for a newly created role.
I hope you find this reply helpful. Please don't hesitate to contact us for any further questions you may have.
Hi Pavel Beno,
Thank you very much for your reply.
I could set permissions for the newly created roles. But the problem is that when I logged in as a user in that specific role (newly created role), I cant access all the permissions set by administrator. That means the menu for that permission in the top will not be shown.
For example, if administrator set pemissions for a TestDesigner (a newly created role).
Say for example administrator is allowing permission for module builder. When I logged as a user in TestDesigner, the module builder will not be seen in anywhere in the dash board.
Hi,
This problem I found not only in any single item. Also in the custom modules its there.
One thing to notice that, I created a TestDesigner role and set permissions as same as the permissions set to the Designer role (already there in version 5.1). But when I logged in as a user in Designer role I can see Design under that Page Templates and Widget Templates options. But when I logged in as a user in TestDesigner role I can see Design under that only Widget Templates option.
Why its like that?? Im missing any settings anywhere??
Please help me..
Hello,
On your first question - after a thurough investigation we found out that this is a bug, so I have logged it in our system for fixing. You can follow the progress in our PITS.
Thank you for bringing this to our attention, your Telerik points have been updated.
On your second question - To set permissions for a custom module you need to go to Administration->Permissions->Your Custom Module. Set the desired functionalities by clicking on Change, from the menu choose Selected roles or users -> Add roles and users.
Hi Please let me know What you mean by this line on your reply "your Telerik points have been updated".
For the reply for my second question,
I have tried all these. But I didn't get way to meet my requirement.
And what is the solution for my third question??
Please reply me.... Please help me..
Hello,
To answer your third question you need to go to Administration -> Backend Pages click "OK, Continue" . Navigate to Sitefinity->Design->Templates where you will see the Page Templates page. From the Actions menu choose Permissions and set the required permissions to your custom role. This time you should be able to see the Page Templates in the Design menu. If you want to edit the page templates with your custom role however, you will need to give permissions to each individual template by going to Design->Page Templates and from the Actions menu for each page template choose Permissions. Instead of doing this manualy for each template you can use this code:
void
SetPermissionsForAllTempaltes(
string
roleName,
params
string
[] actionsToGrant)
RoleManager roleManager = RoleManager.GetManager();
Role role = roleManager.GetRole(roleName);
PageManager pageManager = PageManager.GetManager();
var allTemplates = pageManager.GetTemplates();
foreach
(var template
in
allTemplates)
Permission permission = pageManager.GetPermissions().FirstOrDefault(p =>
p.ObjectId == template.Id &&
p.PrincipalId == role.Id &&
p.SetName == SecurityConstants.Sets.PageTemplates.SetName);
if
(permission ==
null
)
permission = pageManager.CreatePermission(
SecurityConstants.Sets.PageTemplates.SetName,
template.Id,
role.Id);
if
(!template.Permissions.Contains(permission))
template.Permissions.Add(permission);
permission.GrantActions(
true
, actionsToGrant);
pageManager.SaveChanges();
Hi,
Thank you very much Pavel Benov..