add checkSubAdminUser method to OC_JSON class
This commit is contained in:
parent
f503aea099
commit
a5bebb86a5
12
lib/json.php
12
lib/json.php
|
@ -65,6 +65,18 @@ class OC_JSON{
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the user is a subadmin, send json error msg if not
|
||||
*/
|
||||
public static function checkSubAdminUser(){
|
||||
self::checkLoggedIn();
|
||||
if(!OC_Group::inGroup(OC_User::getUser(),'admin') && !OC_SubAdmin::isSubAdmin(OC_User::getUser())){
|
||||
$l = OC_L10N::get('core');
|
||||
self::error(array( 'data' => array( 'message' => $l->t('Authentication error') )));
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Send json error msg
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue