On Tue, 2010-04-13 at 08:13 -0400, Jeff Burke wrote:
Bill Peck wrote:
> On 04/06/2010 09:08 PM, Raymond Mancy wrote:
>> We have a ticket open which details the need to set the ownership of a system by
the group.
>>
>> Currently, all the code relevant to system ownership (and the actions allowed
because of that ownership) revolves around
>> the user as the owner.
>>
>> The areas I can think of that would be affected by such a change are
>> *Changing system ownership
>> *Loaning the system
>> *Changing system details
>> *All searches related to system owner
>>
>> Some other I've missed ?
>>
>> I can think of a couple of ways to go about changing
>>
>> 1)Explicitly allow group ownership.
>> By this I mean being able to enter in a group name in any field which would
have previously asked for a user name.
>> This could be problematic and not very intuitive. Do we have 'group
owner' and a 'user owner' field? Are they mutually exclusive? etc etc
>> The relationship of System.owner would have to change as well.If we want to
contact an owner of a machine how do we do that if it's owned by a group?
>>
>> 2)Allow the owner's group to have owner'esque privileges
>> Allow the owner of a machine to give full ownership rights to their group,
or allow them to specify a group.
>> Need to add a field in the DB.
>> The code changes for this would be simpler. Searches wouldn't have to be
modified (maybe addition of a System/GroupOwner could be added).
>> System would still have a single user who would ultimately be responsible
for the machine.
>>
>>
>> I think #2 would be preferable.
>>
>>
>
> I think number 2 would be preferable too. Implementation wise would we
> create another group mapping?
>
> System.owner
> System.groups
> System.admins
>
> admins would be a new mapping and anyone in that group would be able to
> admin the machine.
>
> I think thats the cleanest. then its simply adding an additional check
> in the following method
>
> def can_admin(self, user=None):
> if user:
> if user == self.owner or user.is_admin():
> return True
> return False
>
>
>> Thoughts ?
I agree this approach is acceptable as well.
+1
>>
>> Raymond