Create Your Own Custom Roles

Create Your Own Custom Roles

There are two steps required to create your own custom roles:
1.    Create a custom XML file that defines the role name, its scope and permissions
2.    Upload the custom XML file to the BrainHoney server

Creating a Custom XML File

Roles are defined by creating a custom XML file named roles.xml. Roles files must conform to a specific XML schema:
    <role entitytype =”D|C|S” name=”rolename” pluralname=”pluralrolename” flags="flags" />

Following are definitions of the attributes of the XML files:

entitytype. Specifies whether this role applies to domains, courses, or sections. Specify D for domain, C for course, or S for section.
name. Unique name for the role. Your administrators will see this name when choosing roles from a list.
pluralname. Plural form for name. Displayed when the plural form is appropriate.
flags. A sum of access rights for this role. See the BrainHoney Role Values section for possible values to sum.

This is a sample roles XML file:
    <role entitytype="D" name="Administrator" pluralname="Administrators" flags="-1" />
    <role entitytype="D" name="Course Coordinator" pluralname="Course Coordinators" flags="0x2200f0020" />
    <role entitytype="D" name="User Coordinator" pluralname="User Coordinators" flags="0x5000000f20" />
    <role entitytype="D" name="Help Desk Support" pluralname="Help Desk Support" flags="0xd7efff0f20" />
    <role entitytype="D" name="Teacher" pluralname="Teachers" flags="0x330300" />
    <role entitytype="C" name="Owner" pluralname="Owners" flags="0x480af0e0000" />
    <role entitytype="C" name="Author" pluralname="Authors" flags="0x40000060000" />
    <role entitytype="C" name="Teacher" pluralname="Teachers" flags="0x4808f060000" />
    <role entitytype="C" name="Teaching Assistant" pluralname="Teaching Assistants" flags="0x40087020000" />
    <role entitytype="C" name="Student" pluralname="Students" flags="0x20001" />
    <role entitytype="C" name="Auditor" pluralname="Auditors" flags="0x20000" />
    <role entitytype="S" name="Owner" pluralname="Owners" flags="0x80cfe00000" />
    <role entitytype="S" name="Teacher" pluralname="Teachers" flags="0x808f200000" />
    <role entitytype="S" name="Teaching Assistant" pluralname="Teaching Assistants" flags="0x87200000" />
    <role entitytype="S" name="Student" pluralname="Students" flags="0x200001" />
    <role entitytype="S" name="Auditor" pluralname="Auditors" flags="0x200000" />

For example, you may want to create a domain role called “Domain Course Author” that allows an individual to easily create courses without requiring administrator action. This user would need domain rights to create, read and edit courses. By giving a user these permissions, they would be able to start creating a course using the BrainHoney Course Builder tool and publish it without administrator course set up and pre-granting author rights to the course. The values for creating this role would contain the following domain rights:

Value     Name     Meaning
0x10000    CreateCourse     User can create courses in a domain
0x20000    ReadCourse     User can read courses in a domain
0x40000    UpdateCourse     User can update courses in a domain

To give a pre-defined role multiple permissions, you must add up the hexadecimal values of each permission. For this example, the value in the XML file should be the sum of the three above values, which equals “0x70000”. Therefore, the XML to create this role in the XML file would look like this:
    <role entitytype="D" name="Domain Course Author" pluralname="Domain Course Authors" flags="0x70000" />

When you have created the file, save it as roles.xml.

Uploading Roles.xml

The next step is to upload the file you created named roles.xml to the content area of a domain. If you do not upload roles.xml to a domain, the domain inherits the roles from the first ancestor domain that does have a roles.xml file, if any.

To upload a roles.xml file:
1.    Login to BrainHoney.
2.    Navigate to the subdomain where you want to add roles. You can skip this step if you are adding roles to your primary domain. Any subdomains will inherit these same roles, unless you upload a unique roles.xml file for each subdomain.
3.    Click the Content tab for the domain.
4.    Click Upload Content.
5.    Browse to the roles.xml file you have created. In the Upload Folder box, type public/shadow
6.    Click OK.

Please note that deleting or altering a roles.xml file does not alter any existing user's access rights; it only affects the role names that appear in Administrator utility screens.