Merge "403 status code added"
This commit is contained in:
commit
f0ed6e02a0
@ -13,6 +13,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from pecan import abort
|
||||
from pecan import request
|
||||
|
||||
from storyboard.api.auth.token_storage import storage
|
||||
@ -55,4 +56,7 @@ def superuser():
|
||||
token_info = token_storage.get_access_token_info(token)
|
||||
user = user_api.user_get(token_info.user_id)
|
||||
|
||||
if not user.is_superuser:
|
||||
abort(403, "This action is limited to superusers only.")
|
||||
|
||||
return user.is_superuser
|
||||
|
Loading…
x
Reference in New Issue
Block a user