Looking for an advice

This is an open forum for any mojoPortal topics that don't fall into the other categories.

This thread is closed to new posts. You must sign in to post in the forums.
12/15/2014 9:55:14 AM
Gravatar
Total Posts 30

Looking for an advice

I need an advice please,

 

I am now planning on building my portal. I will have a lot of roles in the website. And for each role I will have to create a space ( interrelated pages) and in each space there are modules. So I will set my security according to this plan. And since I will have a lot of roles, do you advise to create a page for each role or to create 1 page that contains a module per role ? which performs better? 1 page with a lot of modules or a lot of pages with 1 module?

 

Best.

12/15/2014 10:04:19 AM
Gravatar
Total Posts 18439

Re: Looking for an advice

Since you plan on a lot of roles, I guess you plan on letting a lot of users have edit rights? maybe per user role is what you plan?

I do not recommend letting any stranger or person that you do not know and trust to have any edit rights on any pages.

Make sure you read and understand the section What mojoPortal Is NOT Designed For on our About page.

Other than that I do not have any specific advice on this question.

12/15/2014 11:31:54 AM
Gravatar
Total Posts 30

Re: Looking for an advice

Thanks a lot for your quick reply. Actually its not a per user role.Let me tell u the scenario. I am building a portal for a school, so there will be like a role for each grade level + section + course. and for each role there will be a forum for discussion, an event calendar, a file sharing page, blog, etc . There will be other roles such as the parents of the students, and the teachers. And I need to separate the pages of each role, for example I only need students of grade 1 / Section A to access the pages or modules of grade 1  / Section A. Am just wondering if I should build a page for each role and and assign a view permission for each role on each page or I should build 1 page and add modules for each role. I hope you got my point. 

 

Best.

12/15/2014 11:40:40 AM
Gravatar
Total Posts 18439

Re: Looking for an advice

I would go with a different page rather than have a single page that hides a bunch of modules for users who are not in the module role. The modules would be loaded from the db regardless of whether the user is allowed to view them.

Using a page for each would be more efficient in many ways and less error prone.

I would use as few modules per page as possible to meet the goal.

With page view roles the hidden pages don't cost anything, the whole site map for the entire site menu is cached but nodes are filtered from display by view role. 

12/15/2014 11:49:41 AM
Gravatar
Total Posts 18439

Re: Looking for an advice

think of page level security as the primary security and module level security as only supplemental.

module security is secondary, when we added that it was not with the goal to encourage a lot of hidden modules on a page by view roles, thats ok in a pinch to have 1 or 2 on a page, but I would not treat it as a primary mechanism for showing/hiding things on a page.

the main goal when we added module level supplemental security was because we needed a way to grant a user edit permission on a module without granting edit permission on the page.

12/15/2014 12:22:40 PM
Gravatar
Total Posts 30

Re: Looking for an advice

thanks a lot for your replies, but do you think like having 500 pages with 500 roles and so on, will make the portal not usable ? concerning the speed and the performance of the portal, do you think it might get affected dramatically in such a case? 

 

Best.

12/15/2014 12:39:41 PM
Gravatar
Total Posts 18439

Re: Looking for an advice

in general it should perform fine with that many pages and roles.

page management and role management might be a but unwieldy, we have an add on in our store, Page Manager Pro that can help with the page management.

the site map will be cached in memory and it is a little larger with that many pages but its not too much, this site probably has nearly that many pages and all of them are visible. other than use of a little more memory to cache the site map, the number of pages does not impact performance at all. 

users will only see the pages that correspond to their roles so the navigation experience should not be difficult for the users.

for roles, its ok to have lots of them, but no user should be in more than a few roles, user roles are stored in an encrypted cookie and a cookie can only hold a small amount of data, so if you add a user to lots of roles it will be truncated in the cookie and he would not get all of the roles into the cookie. the only potential problem with lots of roles is back end management of roles might become more difficult

the performance of individual pages is based mainly on how many db hits are needed to generate the page, which is why you want to avoid loading anything that the user is not going to see

performance will mainly be impacted by how many simultaneous users/requests and how much available server resources to process requests and how expensive is each individual request to process, ie how many db hits, how efficient those db hits are

12/15/2014 12:44:51 PM
Gravatar
Total Posts 30

Re: Looking for an advice

Oh I see, I expect that some users will be in like 20 roles, is that ok ? is there a maximum of allowed roles for one user ?

12/15/2014 12:49:16 PM
Gravatar
Total Posts 18439

Re: Looking for an advice

no, that is not a good idea, probably cannot fit that in the cookie. it is not a fixed number though because the role names are stored in the cookie, so it depends how many characters in each role name, short role names would help but more then a few is still to much, you would have to experiment to find the actual limit

why would anyone need to be in 20 roles for permissions? surely you can structure permissions so that only a few roles per user are needed

12/15/2014 12:57:09 PM
Gravatar
Total Posts 30

Re: Looking for an advice

for example when a teacher teaches 3 courses for 3 grade levels, she will be in the following roles: Teachers, Teacher Grade 1, Teacher Grade 1 / A, Teacher Grade 1 / A / English Course, Teacher Grade 2, Teacher Grade 2 / A, Teacher Grade 2 / A Math and so on. So you advise to find an alternative structure ?

12/15/2014 1:11:53 PM
Gravatar
Total Posts 18439

Re: Looking for an advice

without knowing what each role allows how can I suggest a hierarchy, here is strategy advice

it is better to have as few roles as possible attached to the user

it is ok to have lots of allowed roles attached to a page

think of how to use that info to reduce the number of roles per user

to be able to use more roles per user, you should use short role names but they have to be unique obviously

one thing to understand about that. when you create a role the name you enter is used as RoleName and DisplayName in the mp_roles table, roleName is used in the cookie so it must be short as possible but display name is not stored in the cookie so it can be longer.

once a role is created the rolename never changes, if you edit it edits only the displayname,  the only way to edit the rolename is directly in the db or by delete and re-create the role.

so when you create a role use a short name then edit it to make a more friendly display name

plan ahead the short names you will use for each planned role sinc eyou plan a lot of roles, create the role with the short name then edit it to change the display name

12/15/2014 1:16:41 PM
Gravatar
Total Posts 30

Re: Looking for an advice

thanks a lot dear, I really really appreciate your valuable support. keep it up :)

You must sign in to post in the forums. This thread is closed to new posts.