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
31295e76
authored
Jul 11, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: fix lease permissions
parent
c11cf23e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
2 deletions
+4
-2
circle/dashboard/templates/dashboard/template-list.html
+2
-0
circle/dashboard/views.py
+2
-1
circle/vm/models/common.py
+0
-1
No files found.
circle/dashboard/templates/dashboard/template-list.html
View file @
31295e76
...
@@ -26,9 +26,11 @@
...
@@ -26,9 +26,11 @@
<div
class=
"col-md-6"
>
<div
class=
"col-md-6"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
<div
class=
"panel-heading"
>
{% if perms.vm.create_leases %}
<a
href=
"{% url "
dashboard
.
views
.
lease-create
"
%}"
class=
"pull-right btn btn-success btn-xs"
style=
"margin-right: 10px;"
>
<a
href=
"{% url "
dashboard
.
views
.
lease-create
"
%}"
class=
"pull-right btn btn-success btn-xs"
style=
"margin-right: 10px;"
>
<i
class=
"icon-plus"
></i>
{% trans "new lease" %}
<i
class=
"icon-plus"
></i>
{% trans "new lease" %}
</a>
</a>
{% endif %}
<h3
class=
"no-margin"
><i
class=
"icon-time"
></i>
{% trans "Leases" %}
</h3>
<h3
class=
"no-margin"
><i
class=
"icon-time"
></i>
{% trans "Leases" %}
</h3>
</div>
</div>
<div
class=
"panel-body"
>
<div
class=
"panel-body"
>
...
...
circle/dashboard/views.py
View file @
31295e76
...
@@ -2285,10 +2285,11 @@ class VmMassDelete(LoginRequiredMixin, View):
...
@@ -2285,10 +2285,11 @@ class VmMassDelete(LoginRequiredMixin, View):
return
redirect
(
next
if
next
else
reverse_lazy
(
'dashboard.index'
))
return
redirect
(
next
if
next
else
reverse_lazy
(
'dashboard.index'
))
class
LeaseCreate
(
LoginRequiredMixin
,
Superuser
RequiredMixin
,
class
LeaseCreate
(
LoginRequiredMixin
,
Permission
RequiredMixin
,
SuccessMessageMixin
,
CreateView
):
SuccessMessageMixin
,
CreateView
):
model
=
Lease
model
=
Lease
form_class
=
LeaseForm
form_class
=
LeaseForm
permission_required
=
'vm.create_leases'
template_name
=
"dashboard/lease-create.html"
template_name
=
"dashboard/lease-create.html"
success_message
=
_
(
"Successfully created a new lease."
)
success_message
=
_
(
"Successfully created a new lease."
)
...
...
circle/vm/models/common.py
View file @
31295e76
...
@@ -97,7 +97,6 @@ class Lease(AclBase):
...
@@ -97,7 +97,6 @@ class Lease(AclBase):
ordering
=
[
'name'
,
]
ordering
=
[
'name'
,
]
permissions
=
(
permissions
=
(
(
'create_leases'
,
_
(
'Can create new leases.'
)),
(
'create_leases'
,
_
(
'Can create new leases.'
)),
(
'bypass_leases'
,
_
(
'Can set arbitrary expiration times.'
)),
)
)
@property
@property
...
...
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