webtechnick / CakePHP-Facebook-Plugin

CakePHP Facebook Plugin
http://facebook.webtechnick.com
445 stars 138 forks source link

Added developer roles function to Connect component #98

Closed zodouglass closed 11 years ago

zodouglass commented 11 years ago

Modified Connect Component:

added functions to get all developer roles for the application, and the current user's developer role for an application. Roles include (administrators, developers, testers, insight users).

Common use is saving the role to the user model in beforeFacebookSave: function beforeFacebookSave(){ $this->Connect->authUser['User']['email'] = $this->Connect->user('email'); $this->Connect->authUser['User']['username'] = $this->Connect->user('name'); $this->Connect->authUser['User']['role'] = $this->Connect->role(); return true; }

And restricting certain areas of the site to certain roles:

if ($user['role'] == 'administrators') { echo "admins only section"; }