Commit af853c19 by Szabolcs Gelencser

cleanup acl

parent 23530b0b
......@@ -2,51 +2,8 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="1fbec8af-5a7c-40f9-b994-83ac07d1ae1d" name="Default" comment="">
<change beforePath="" afterPath="$PROJECT_DIR$/circle/acl/views.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/circle/settings/static_and_pipeline.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/circle/settings/util.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/dashboard/migrations/0007_profile_network_limit.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/index-vxlans.html" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/network/migrations/0001_initial.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/network/migrations/0002_auto_20171110_0041.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/network/migrations/0003_editorelement.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/network/migrations/__init__.py" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/network/static/network/editor.es6" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/network/static/network/editor.less" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/network/templates/network/editor.html" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/network/templates/network/vxlan-create.html" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/network/templates/network/vxlan-edit.html" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/network/templates/network/vxlan-list.html" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/network/templates/network/vxlan-superuser-create.html" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/network/templates/network/vxlan-superuser-edit.html" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/network/templates/network/vxlan-superuser-list.html" />
<change beforePath="" afterPath="$PROJECT_DIR$/circle/vm/migrations/0003_auto_20171105_2011.py" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change beforePath="$PROJECT_DIR$/circle/bower.json" afterPath="$PROJECT_DIR$/circle/bower.json" />
<change beforePath="$PROJECT_DIR$/circle/circle/db.sqlite3" afterPath="$PROJECT_DIR$/circle/circle/db.sqlite3" />
<change beforePath="$PROJECT_DIR$/circle/circle/settings/base.py" afterPath="$PROJECT_DIR$/circle/circle/settings/base.py" />
<change beforePath="$PROJECT_DIR$/circle/circle/settings/local.py" afterPath="$PROJECT_DIR$/circle/circle/settings/local.py" />
<change beforePath="$PROJECT_DIR$/circle/circle/urls.py" afterPath="$PROJECT_DIR$/circle/circle/urls.py" />
<change beforePath="$PROJECT_DIR$/circle/common/views.py" afterPath="$PROJECT_DIR$/circle/common/views.py" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/forms.py" afterPath="$PROJECT_DIR$/circle/dashboard/forms.py" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/management/commands/init.py" afterPath="$PROJECT_DIR$/circle/dashboard/management/commands/init.py" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/models.py" afterPath="$PROJECT_DIR$/circle/dashboard/models.py" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/static/dashboard/activity.js" afterPath="$PROJECT_DIR$/circle/dashboard/static/dashboard/activity.js" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/static/dashboard/dashboard.js" afterPath="$PROJECT_DIR$/circle/dashboard/static/dashboard/dashboard.js" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/static/dashboard/dashboard.less" afterPath="$PROJECT_DIR$/circle/dashboard/static/dashboard/dashboard.less" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/index.html" afterPath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/index.html" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/network.html" afterPath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/network.html" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-list.html" afterPath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-list.html" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/views/index.py" afterPath="$PROJECT_DIR$/circle/dashboard/views/index.py" />
<change beforePath="$PROJECT_DIR$/circle/network/forms.py" afterPath="$PROJECT_DIR$/circle/network/forms.py" />
<change beforePath="$PROJECT_DIR$/circle/network/models.py" afterPath="$PROJECT_DIR$/circle/network/models.py" />
<change beforePath="$PROJECT_DIR$/circle/network/tables.py" afterPath="$PROJECT_DIR$/circle/network/tables.py" />
<change beforePath="$PROJECT_DIR$/circle/network/templates/network/dashboard.html" afterPath="$PROJECT_DIR$/circle/network/templates/network/dashboard.html" />
<change beforePath="$PROJECT_DIR$/circle/network/urls.py" afterPath="$PROJECT_DIR$/circle/network/urls.py" />
<change beforePath="$PROJECT_DIR$/circle/network/views.py" afterPath="$PROJECT_DIR$/circle/network/views.py" />
<change beforePath="$PROJECT_DIR$/circle/vm/models/instance.py" afterPath="$PROJECT_DIR$/circle/vm/models/instance.py" />
<change beforePath="$PROJECT_DIR$/circle/vm/models/network.py" afterPath="$PROJECT_DIR$/circle/vm/models/network.py" />
<change beforePath="$PROJECT_DIR$/circle/vm/operations.py" afterPath="$PROJECT_DIR$/circle/vm/operations.py" />
<change beforePath="$PROJECT_DIR$/circle/acl/views.py" afterPath="" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
......@@ -244,13 +201,13 @@
<item name="cloud" type="b2602c69:ProjectViewProjectNode" />
<item name="cloud" type="462c0819:PsiDirectoryNode" />
<item name="circle" type="462c0819:PsiDirectoryNode" />
<item name="acl" type="462c0819:PsiDirectoryNode" />
<item name="circle" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="cloud" type="b2602c69:ProjectViewProjectNode" />
<item name="cloud" type="462c0819:PsiDirectoryNode" />
<item name="circle" type="462c0819:PsiDirectoryNode" />
<item name="circle" type="462c0819:PsiDirectoryNode" />
<item name="network" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="cloud" type="b2602c69:ProjectViewProjectNode" />
......@@ -848,7 +805,7 @@
<state relative-caret-position="170">
<caret line="35" column="32" lean-forward="false" selection-start-line="35" selection-start-column="32" selection-end-line="35" selection-end-column="32" />
<folding>
<element signature="e#732#760#0" expanded="true" />
<element signature="e#732#760#0" expanded="false" />
</folding>
</state>
</provider>
......@@ -858,7 +815,7 @@
<state relative-caret-position="299">
<caret line="198" column="25" lean-forward="true" selection-start-line="198" selection-start-column="25" selection-end-line="198" selection-end-column="25" />
<folding>
<element signature="e#732#788#0" expanded="true" />
<element signature="e#732#788#0" expanded="false" />
</folding>
</state>
</provider>
......@@ -876,7 +833,7 @@
<state relative-caret-position="-931">
<caret line="55" column="61" lean-forward="false" selection-start-line="55" selection-start-column="61" selection-end-line="55" selection-end-column="61" />
<folding>
<element signature="e#732#770#0" expanded="true" />
<element signature="e#732#770#0" expanded="false" />
</folding>
</state>
</provider>
......@@ -902,7 +859,7 @@
<state relative-caret-position="182">
<caret line="965" column="84" lean-forward="false" selection-start-line="965" selection-start-column="84" selection-end-line="965" selection-end-column="84" />
<folding>
<element signature="e#732#746#0" expanded="true" />
<element signature="e#732#746#0" expanded="false" />
</folding>
</state>
</provider>
......
# Copyright 2014 Budapest University of Technology and Economics (BME IK)
#
# This file is part of CIRCLE Cloud.
#
# CIRCLE is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# CIRCLE is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along
# with CIRCLE. If not, see <http://www.gnu.org/licenses/>.
from django.core.exceptions import PermissionDenied
class CheckedObjectMixin(object):
read_level = 'user'
def get_object(self, **kwargs):
obj = super(CheckedObjectMixin, self).get_object()
if not obj.has_level(self.request.user, self.read_level):
raise PermissionDenied()
return obj
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment