Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
aafa29bf
authored
Aug 04, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: create base vm with only base vm right
Closes #236
parent
18eec1a7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
circle/dashboard/forms.py
+4
-2
circle/dashboard/views.py
+1
-1
No files found.
circle/dashboard/forms.py
View file @
aafa29bf
...
@@ -450,8 +450,10 @@ class TemplateForm(forms.ModelForm):
...
@@ -450,8 +450,10 @@ class TemplateForm(forms.ModelForm):
self
.
allowed_fields
=
()
self
.
allowed_fields
=
()
else
:
else
:
self
.
allowed_fields
=
(
self
.
allowed_fields
=
(
'name'
,
'access_method'
,
'description'
,
'system'
,
'tags'
)
'name'
,
'access_method'
,
'description'
,
'system'
,
'tags'
,
if
self
.
user
.
has_perm
(
'vm.change_template_resources'
):
'arch'
,
'lease'
)
if
(
self
.
user
.
has_perm
(
'vm.change_template_resources'
)
or
not
self
.
instance
.
pk
):
self
.
allowed_fields
+=
tuple
(
set
(
self
.
fields
.
keys
())
-
self
.
allowed_fields
+=
tuple
(
set
(
self
.
fields
.
keys
())
-
set
([
'raw_data'
]))
set
([
'raw_data'
]))
if
self
.
user
.
is_superuser
:
if
self
.
user
.
is_superuser
:
...
...
circle/dashboard/views.py
View file @
aafa29bf
...
@@ -1376,7 +1376,7 @@ class TemplateCreate(SuccessMessageMixin, CreateView):
...
@@ -1376,7 +1376,7 @@ class TemplateCreate(SuccessMessageMixin, CreateView):
def
get_context_data
(
self
,
*
args
,
**
kwargs
):
def
get_context_data
(
self
,
*
args
,
**
kwargs
):
context
=
super
(
TemplateCreate
,
self
)
.
get_context_data
(
*
args
,
**
kwargs
)
context
=
super
(
TemplateCreate
,
self
)
.
get_context_data
(
*
args
,
**
kwargs
)
num_leases
=
Lease
.
get_objects_with_level
(
"
use
r"
,
num_leases
=
Lease
.
get_objects_with_level
(
"
operato
r"
,
self
.
request
.
user
)
.
count
()
self
.
request
.
user
)
.
count
()
can_create_leases
=
self
.
request
.
user
.
has_perm
(
"create_leases"
)
can_create_leases
=
self
.
request
.
user
.
has_perm
(
"create_leases"
)
context
.
update
({
context
.
update
({
...
...
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