Why do we need roles?
Imagin that you and a friend of yours are managing a website. Maybe you are a successful webdesigner whereas your friend has no idea about CSS but is a committed writer. Therefor you have decided to divide the work. In the future, you will be doing the design and administration of the website and your friend will be writing articles (by the way, this is a basic principle of any CMS: separation of content and design).Now, as both of you have to have access to the back end, your friend would still be able to edit the look of the website or to create new user accounts, although he is not responsible for design or administration any more. Therefor, you might want to disable these functions for his account. At this point, you have created a role (although it exists in your mind only) that you could name "editor" or "author".
To learn how user permissions can be restricted, we will take a closer look at the roles of our example users.
1. Kevin Jones
He is the administrator of the website and he has access to all modules and functions. To create an administrator account, simply create a new user and choose the option administrator.
He is the administrator of the website and he has access to all modules and functions. To create an administrator account, simply create a new user and choose the option administrator.
2. Helen Lewis
She is one of the academy professors who are responsible for the course pages. Each course has its own subpage that is managed by the respective professor. The main course page is managed by all professors. Mrs. Lewis is also in charge of news and events and therefor she needs access to the news module.
As Mrs. Lewis is not the only editor, it makes sense to create a role (user group) called Editors. Open module User groups and take a look at the group Editors. As you can see, there are only three modules activated. Each editor (professor) needs to access module navigation (to modify a page), module articles (to publish articles on his page) and module file manager (to upload images or documents).
She is one of the academy professors who are responsible for the course pages. Each course has its own subpage that is managed by the respective professor. The main course page is managed by all professors. Mrs. Lewis is also in charge of news and events and therefor she needs access to the news module.
As Mrs. Lewis is not the only editor, it makes sense to create a role (user group) called Editors. Open module User groups and take a look at the group Editors. As you can see, there are only three modules activated. Each editor (professor) needs to access module navigation (to modify a page), module articles (to publish articles on his page) and module file manager (to upload images or documents).
Now open module User and take a look at Mrs. Lewis account. As you can see, the group permissions are extended by some custom settings that apply to her account only. Let us take a closer look at the setting pagemounts. As TYPOlight is a tree-based content management system, each fontend page matches a page in the navigation tree. To enable a page for a certain user, we will have to "mount" it into his personal page tree. The same principle applies to the files directory and its subfolders as well.
As for Mrs. Lewis, we have chosen the page Courses 2006 as mounting point. All subpages are included automatically. Now, if you log in as Mrs. Lewis, you will only see these three pages in the navigation tree.
As for Mrs. Lewis, we have chosen the page Courses 2006 as mounting point. All subpages are included automatically. Now, if you log in as Mrs. Lewis, you will only see these three pages in the navigation tree.
3. James Wilson
Mr. Wilson is an assocciate professor for Jazz Piano and he is also in charge of the main courses page. Therefor he uses the same pagemounts as Mrs. Lewis and he can also see her page Violin Master Class. However, he is not able to edit it - which is correct as this is Mrs. Lewis' page.
Now log in to the back end as administrator (k.jones), open module navigation and edit page Elements of Jazz Piano. You will find an option called Assign permissions - which you should not see when you are logged in as James Wilson. Here you can define the owner of a page (a user and a group). As you can see, there are three ways to relate to a page: as the user who owns the page, as the group who owns the page or as someone else. Each role has its own set of permissions (similar to the UNIX chmod utility).
Of course, the page Elements of Jazz Piano belongs to Mr. Wilson and he is the only one who is allowed to do something with the page (which is not 100% true as an administrator has access to all pages and modules!).
Mr. Wilson is an assocciate professor for Jazz Piano and he is also in charge of the main courses page. Therefor he uses the same pagemounts as Mrs. Lewis and he can also see her page Violin Master Class. However, he is not able to edit it - which is correct as this is Mrs. Lewis' page.
Now log in to the back end as administrator (k.jones), open module navigation and edit page Elements of Jazz Piano. You will find an option called Assign permissions - which you should not see when you are logged in as James Wilson. Here you can define the owner of a page (a user and a group). As you can see, there are three ways to relate to a page: as the user who owns the page, as the group who owns the page or as someone else. Each role has its own set of permissions (similar to the UNIX chmod utility).
Of course, the page Elements of Jazz Piano belongs to Mr. Wilson and he is the only one who is allowed to do something with the page (which is not 100% true as an administrator has access to all pages and modules!).
4. John Smith
John Smith is a Piano student and he attends Mr. Wilson's class. If you log in to the front end as j.smith, you will recognize three additional pages in the website navigation menu that were not visible before (Elements of Jazz Piano, My account and Logout). These pages are protected and therefor hidden unless a student has logged in.
Go to the back end again, open module navigation and edit page Elements of Jazz Piano. You will find the options Protect page and Allowed member groups which lets you choose one or more groups that will be allowed to access the page. If you do not choose a group, the page will be visible to any logged in front end user.
Our example page Elements of Jazz Piano is only visible to members of the group Piano students. You will not be able to access the page when you are logged in as Donna Evans or when you are not logged in at all.
John Smith is a Piano student and he attends Mr. Wilson's class. If you log in to the front end as j.smith, you will recognize three additional pages in the website navigation menu that were not visible before (Elements of Jazz Piano, My account and Logout). These pages are protected and therefor hidden unless a student has logged in.
Go to the back end again, open module navigation and edit page Elements of Jazz Piano. You will find the options Protect page and Allowed member groups which lets you choose one or more groups that will be allowed to access the page. If you do not choose a group, the page will be visible to any logged in front end user.
Our example page Elements of Jazz Piano is only visible to members of the group Piano students. You will not be able to access the page when you are logged in as Donna Evans or when you are not logged in at all.
5. Donna Evans
Donna Evans is a Violin student and she attends Mrs. Lewis class. On the protected page My account you could change Donna Evans' personal data. This feature is part of a front end module called Personal data. As you can see, there are back end modules and front end modules (which are always part of a page layout).
Here is another basic principle of TYPOlight concerning the setup of a page: a page uses a certain page layout and a page layout uses certain front end modules and one or more style sheets. Following this principle, you might want to create new pages in the following order:
a. Create all necessary front end modules
b. Create all necessary style sheets
c. Create a page layout and include your front end modules and your style sheets
d. Create the page and include the layout
Open module Page layout and take a look at the default layout. As you can see, you can choose between a one column, a two column or a three column layout and you can add an additional header and footer element. These main page elements divide a page into different "areas" and create the basic page layout.
Donna Evans is a Violin student and she attends Mrs. Lewis class. On the protected page My account you could change Donna Evans' personal data. This feature is part of a front end module called Personal data. As you can see, there are back end modules and front end modules (which are always part of a page layout).
Here is another basic principle of TYPOlight concerning the setup of a page: a page uses a certain page layout and a page layout uses certain front end modules and one or more style sheets. Following this principle, you might want to create new pages in the following order:
a. Create all necessary front end modules
b. Create all necessary style sheets
c. Create a page layout and include your front end modules and your style sheets
d. Create the page and include the layout
Open module Page layout and take a look at the default layout. As you can see, you can choose between a one column, a two column or a three column layout and you can add an additional header and footer element. These main page elements divide a page into different "areas" and create the basic page layout.
After you have created the basic page layout, you will be able to include your front end modules (you might have to save your changes in order to make TYPOlight show all columns). Front end modules will be shown one below the other, hence you can change the order within each column.
Here is a screenshot of the modules included in the layout of the current page.
Here is a screenshot of the modules included in the layout of the current page.