Implement permission checking for OAuth clients using the xperm table. Currently 'all' permissions are applied to OAuth clients which gives them the same rights as the channel owner and full access to API functions as the channel owner. However, individual permissions can now be created. These mirror the permission names from the normal permission table (although it isn't required that they do so). Lack of an xp_perm entry for the specified permission and lack of an 'all' override indicates permission denied.

This commit is contained in:
redmatrix
2015-05-17 18:14:50 -07:00
parent a7071b17c0
commit 3b859aa9ef
5 changed files with 106 additions and 6 deletions

View File

@@ -78,11 +78,14 @@ require_once('include/items.php');
// list($consumer,$token) = $oauth->verify_request(OAuthRequest::from_request());
if (!is_null($token)){
$oauth->loginUser($token->uid);
$a->set_oauth_key($consumer->key);
call_hooks('logged_in', $a->user);
return;
}
echo __file__.__line__.__function__."<pre>";
var_dump($consumer, $token);
// var_dump($consumer, $token);
die();
}
catch(Exception $e) {