In the Football Stars application, every unauthenticated visitor can register and create account. The non-logged users have access to add users view:
During registration, the non-logged user must fill in the ‘Name’, ‘Username’, ‘Password’ and ‘Password Confirmation’ inputs but cannot choose role. The default role for each new user created by unauthenticated visitors is ‘user’.
Non-logged user’s add view:
The admin can also create new users, but admin can set up new user’s role (‘user’ or ‘admin’ role):
The public function that checks if logged user’s role is ‘admin’:
Admin add (register new users) view: