~ubuntu-branches/ubuntu/precise/horizon/precise-updates

« back to all changes in this revision

Viewing changes to horizon/dashboards/nova/images_and_snapshots/images/tables.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-03-20 14:49:24 UTC
  • mfrom: (1.1.11)
  • Revision ID: package-import@ubuntu.com-20120320144924-s8rpema4nnko6oeg
Tags: 2012.1~rc1-0ubuntu1
New upstream release. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 
33
33
    def allowed(self, request, image=None):
34
34
        if image:
35
 
            return image.owner == request.user.id
 
35
            return image.owner == request.user.tenant_id
 
36
        # Return True to allow table-level bulk delete action to appear.
36
37
        return True
37
38
 
38
39
    def delete(self, request, obj_id):
52
53
    url = "horizon:nova:images_and_snapshots:images:update"
53
54
    classes = ("ajax-modal", "btn-edit")
54
55
 
 
56
    def allowed(self, request, image=None):
 
57
        if image:
 
58
            return image.owner == request.user.tenant_id
 
59
        # We don't have bulk editing, so if there isn't an image that's
 
60
        # authorized, don't allow the action.
 
61
        return False
 
62
 
55
63
 
56
64
def get_image_type(image):
57
65
    return getattr(image.properties, "image_type", "Image")