示例#1
0
文件: User.php 项目: apioo/fusio-impl
 protected function insertScopes($userId, $scopes)
 {
     if (!empty($scopes) && is_array($scopes)) {
         $scopes = $this->scopeTable->getByNames($scopes);
         foreach ($scopes as $scope) {
             $this->userScopeTable->create(array('userId' => $userId, 'scopeId' => $scope['id']));
         }
     }
 }
示例#2
0
文件: App.php 项目: apioo/fusio-impl
 public function insertScopes($appId, $scopes)
 {
     if (!empty($scopes) && is_array($scopes)) {
         $scopes = $this->scopeTable->getByNames($scopes);
         foreach ($scopes as $scope) {
             $this->appScopeTable->create(array('appId' => $appId, 'scopeId' => $scope['id']));
         }
     }
 }