Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c2a42986
authored
Dec 04, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: move vlan perm check to Instance.create
parent
77236999
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
circle/vm/models/instance.py
+6
-4
No files found.
circle/vm/models/instance.py
View file @
c2a42986
...
@@ -354,6 +354,12 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
...
@@ -354,6 +354,12 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
def
create
(
cls
,
params
,
disks
,
networks
,
req_traits
,
tags
):
def
create
(
cls
,
params
,
disks
,
networks
,
req_traits
,
tags
):
""" Create new Instance object.
""" Create new Instance object.
"""
"""
# permission check
for
network
in
networks
:
if
not
network
.
vlan
.
has_level
(
params
[
'owner'
],
'user'
):
raise
PermissionDenied
()
# create instance and do additional setup
# create instance and do additional setup
inst
=
cls
(
**
params
)
inst
=
cls
(
**
params
)
...
@@ -408,10 +414,6 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
...
@@ -408,10 +414,6 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
networks
=
(
template
.
interface_set
.
all
()
if
networks
is
None
networks
=
(
template
.
interface_set
.
all
()
if
networks
is
None
else
networks
)
else
networks
)
for
network
in
networks
:
if
not
network
.
vlan
.
has_level
(
owner
,
'user'
):
raise
PermissionDenied
()
req_traits
=
(
template
.
req_traits
.
all
()
if
req_traits
is
None
req_traits
=
(
template
.
req_traits
.
all
()
if
req_traits
is
None
else
req_traits
)
else
req_traits
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment