Changeset 767 in main


Ignore:
Timestamp:
02/17/12 09:15:01 (10 years ago)
Author:
pcosquer
Message:

controller: documents when to use set_owner or set_role

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/openPLM/plmapp/controllers/plmobject.py

    r752 r767  
    336336        """ 
    337337        Sets *new_owner* as current owner. 
     338 
     339        .. note:: 
     340            This method does **NOT** check that the current user 
     341            is the owner of the object. :meth:`set_role` does that check.  
    338342         
    339343        :param new_owner: the new owner 
     
    440444        .. note:: 
    441445            If *role* is `owner` or a sign role, the old user who had 
    442             this role will lose it. 
     446            this role will lose it. Only the owner can changes these 
     447            roles. 
    443448 
    444449            If *role* is notified, others roles are preserved. 
    445          
     450 
    446451        :raise: :exc:`ValueError` if *role* is invalid 
    447452        :raise: :exc:`.PermissionError` if *user* is not allowed to has role 
     
    449454        """ 
    450455        if role == "owner": 
     456            self.check_permission("owner") 
    451457            self.set_owner(user) 
    452458        elif role == "notified": 
    453459            self.add_notified(user) 
    454460        elif role.startswith("sign"): 
     461            self.check_permission("owner") 
    455462            self.set_signer(user, role) 
    456463        else: 
Note: See TracChangeset for help on using the changeset viewer.