Skip to content

Commit

Permalink
[authentication] *Implements admin permission
Browse files Browse the repository at this point in the history
  • Loading branch information
LaercioSantana committed Jul 4, 2016
1 parent 61375ac commit cd8bf41
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion application/controllers/Authentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function getPermission(){
return $this->permission;
}
public function valid($permission){
if($this->getPermission() != $permission)
if($this->getPermission() != $permission && $this->getPermission() != Authentication::ADMIN_PERMISSION)
return false;

return true;
Expand All @@ -24,6 +24,7 @@ public function valid($permission){
class Authentication extends CI_Controller {
const CLIENT_PERMISSION = 1;
const TRACKER_PERMISSION = 2;
const ADMIN_PERMISSION = 3;

final function authenticate(){
//decode token
Expand Down

0 comments on commit cd8bf41

Please sign in to comment.