Services:UserService

From MacroDeckDevWiki

(Redirected from UserService)
Jump to: navigation, search

UserService provides functions for managing users, groups, and in the future, permissions.

Concepts

Every user can belong to more than one group. In each group, they can be an administrator, moderator, or user. Currently, the privileges of these levels aren't defined, but in the future, groups will probably give each level different privileges depending on their needs. Users can also create their own groups.

Passwords are hashed and salted. By default, we're using SHA512 as the hashing algorithm. If a better one becomes available, we can create support for it as well.

Permissions

We store permissions in the database as a YAML-serialized version of the following structure:

 [
 { :id => "UUID", :action => :deny },
 { :id => "another UUID", :action => :deny },
 { :id => "everyone", :action => :allow }
 ]

When permissions are used, the database typically contains a read_permissions column and a write_permissions column, making it flexible (although if there were an object type that only needed one kind of permission there would only be one). The checkPermissions function, used to see if a particular UUID is allowed access, expects an array and not YAML.


Image:Ruby.png This service has RDoc documentation here.
Personal tools