Commit 4e8d69bd by Tom Laudeman

draft method list for the API

parent 90be9b4a
...@@ -193,56 +193,56 @@ success. ...@@ -193,56 +193,56 @@ success.
--- ---
saveUser(snac\data\User $user) `saveUser(snac\data\User $user)`
Update a user record. Verify that read-only fields match, overwrite everthing else with values from the User Update a user record. Verify that read-only fields match, overwrite everthing else with values from the User
object. Return true for success. object. Return true for success.
--- ---
readUser($userID or $email) `readUser($userID or $email)`
Return a User object for the user id or email. Return false on failure. Return a User object for the user id or email. Return false on failure.
--- ---
disableUser(snac\data\User $user) `disableUser(snac\data\User $user)`
Disable log in to this account. Update table appuser.active to false. Return true on success. Disable log in to this account. Update table appuser.active to false. Return true on success.
--- ---
addUserRole(snac\data\User $user, $newRole) `addUserRole(snac\data\User $user, $newRole)`
Add a role to the User via table appuser_role_link. Return true on success. Add a role to the User via table appuser_role_link. Return true on success.
--- ---
listRoles() `listRoles()`
List all system roles. The simpliest form would be an associative list with keys: id, label, description. List all system roles. The simpliest form would be an associative list with keys: id, label, description.
--- ---
createRole($label, $description) `createRole($label, $description)`
Create a new role with $label and $description. Return true on success. Create a new role with $label and $description. Return true on success.
--- ---
checkPassword(snac\data\User $user, $passwd) `checkPassword(snac\data\User $user, $passwd)`
Check $passwd matches the password stored for snac\data\User. Return true on success. Check $passwd matches the password stored for snac\data\User. Return true on success.
--- ---
addSession(snac\data\User $user, $accessToken, $expire) `addSession(snac\data\User $user, $accessToken, $expire)`
Add a new session token $accessToken with expiration time $expire for $user. Update if $accessToken exists. Add a new session token $accessToken with expiration time $expire for $user. Update if $accessToken exists.
--- ---
checkSessionActive(snac\data\User $user, $accessToken) `checkSessionActive(snac\data\User $user, $accessToken)`
Check that a session is active (not expired) for $user and $accessToken. Time is assumed to be "now". Return Check that a session is active (not expired) for $user and $accessToken. Time is assumed to be "now". Return
true for success (session is active now). true for success (session is active now).
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment