The EuroCMS Accounts Module

AuthorRevision
Imri Palojadraft

The Accounts module manages all the accounts of an ECMS installation. EuroCMS applies the following control lists: RBAC, LBAC.

Domain-Role-Based Access Control List. DRBAC. Dr. Bac if you want to be cute about it.

  • Users

  • Groups

  • API Users

  • Roles

  • Permissions

Chain of Commands

A user in a lower chain of command cannot view and or delete anything of a user that is higher in the Chain Of Command.

No matter if the users has the, for example users_history permission, they cannot view the history of a user higher in command.

ACL FLOW

This is the step by step ACL FLOW:

  • Login

Credentials check

  • Roles

Getting the list of components the users has rights too.

This will be displayed in the admin navigation menu.

  • Permissions

When clicked on, for example, the link for the Users module, we will check for the specific permissions this logged in users has: (users_add,users_delete).

Users

The EuroCMS users.

There can only be one Owner user. This user is the owner of the entire EuroCMS installation. The admins are the next in command in terms of power. Although they can be admin of a website and or websites, they don't have these power by default. The owner users has no restrictions. It's advised, even if you have only one domain, to create an admin account with all needed permissions to work, and never use the Owner user.

user_idgroup_iddomain_iddnamefnamelnameunamepwordemailprofile_picrolereg_dateact_dateauth_methodstimezonecocstatus
111jdoeJohndoejohn{hash}john@doe.nl{URL}Owner{epoch_date}{epoch_date}credsEurope/Amsterdam1active
211,2janeJanedoeJane{hash}jane@doe.nlfile_id:6admin{epoch_date}{epoch_date}creds,email,telegramMars/Marineris2inactive
311jackJackdoeJack{hash}jack@doe.nlEdiThors{epoch_date}{epoch_date}telegramMars/Anseris3banned
412Johndoejohn{hash}john@doe.nladmin{epoch_date}{epoch_date}emailEurope/Amsterdam2active
512JanedoeJane{hash}jane@doe.nlEdiThors{epoch_date}{epoch_date}credsEurope/Amsterdam3active
612JaguesdoeJagues{hash}jag@doe.nlcontributor{epoch_date}{epoch_date}credsEurope/Amsterdam4active
712ECLIecliecli{hash}ecli@ecms.nlecli{epoch_date}{epoch_date}credsEurope/Amsterdam4active

Handle the IP blocking via the content module? IP blocking the /login page?

Contemplate if it's still useful to enable IP blocking per users if the /login page is already blocked via content.

Let's paint a scenario. A user is out of office/on holiday/at a meeting in a restaurant, they need him ASAP, to fix things. The /login page is IP blocked with the Office IP.

So, you connect to the Office VPN, and connect to the /login page. No need for the office.

You can implemented a wide variety of security for this, it's just how secure you want it. The current security implementation makes it highly secure.

After user feedback, with the v1, we will see if the demand for further security implementation is wanted.

To he honest, I'll probably want to implement all of the security implementations you can think of. To make it a highly interesting products for companies/governments/..., with high security demands.

Groups

The EuroCMS groups.

group_iddomain_iduser_idnamepretty_namepwordemailroleusers_idsuser_lockstatus
111edevECMS Developers{hash}edev@eurobytes.euEdiThors3,51enabled
211administratorsAdmin{hash}admins@eurobytes.euAdminStars21enabled

Roles

A role can have preset R/W settings for a specific ECMS components.

role_iddomain_iduser_idgroup_idnameshort_descriptionmodulespermissions_idHierarchy/ChainOfCommand?user_lockstatus
1111ownerThe owner of this EuroCMS installationallall11enabled
2111EdiThorsThe editor rolesusers,editor,files,analytics,widgets1,2,3,5,62nullenabled
3111AdminStarsThe domain administrator usersusers,editor,files,analytics,widgets1,2,3,4,53nullenabled
4111ecliThe ECLI usersupdates,maintenance1,2,3,4,52nullenabled

Permissions

The permissions/features are the features that the module has made available.

SELECT * FROM permissions WHERE component_name = 'users' AND permission_id in (1,2,3,5,6);
permission_iddomain_iduser_idgroup_idcomponent_typecomponent_namepermission_nameshort_descriptionuser_lockstatus
1111moduleusersusers_addThe ability to add usersnullenabled
2111moduleusersusers_deleteThe ability to delete usersnullenabled
3111moduleusersusers_mfaThe ability to modify existing usersnullenabled
4111modulefilesusers_modifyThe ability to setup MFAnullenabled
5111modulefilesfiles_uploadThe ability to upload files.nullenabled
6111modulethemestheme_addThe ability to add themesnullenabled
7111modulecontentcontent_addThe ability to add contentnullenabled
8111modulecontentcontent_deleteThe ability to delete contentnullenabled
9111modulecontentcontent_modifyThe ability to modify existing contentnullenabled
10111modulecontentcontent_ipThe ability to IP protect a contentnullenabled
11111modulecontentcontent_ajaxThe ability to add AJAX contentnullenabled
12111modulecontentcontent_objectThe ability to add auto generated files from variables(robots.txt/sitemap.xml/contribute.json)nullenabled

Users module permissions list

namedescription.........
users_addThe ability to add users
users_deleteThe ability to delete users
users_modifyThe ability to modify users
users_mfaThe ability to setup MFA
users_historyDisplay the actions of users(the actions displayed in the analytics table)
users_info_permissionsDisplay the users permission list.
users_rolesManage users roles
users_permissionsManage roles permissions list

Access Control List

Think about using a PHP constant for this?

$acl_base = array(
	"components" => array()
);

// user logged in,
// Get the users permission...

$acl_add = array(
    "components" => array(
      "modules" => array(
        "Users" => array("users_add","users_delete"),
        "Files" => array()
      ),
      "themes" => array("W3schools"),
    )
);



$acl = array_merge($acl_base, $acl_add);

print_r($acl);

output of the above code:

Array
(
    [components] => Array
        (
            [modules] => Array
                (
                    [Users] => Array
                        (
                            [0] => users_add
                            [1] => users_delete
                        )

                    [Files] => Array
                        (
                        )

                )

            [themes] => Array
                (
                    [0] => W3schools
                )

        )

)

Reference