Sphene Community Tools

Community

Copyright © 2007-2018 by Herbert Poul

You are not logged in.
Login
Register

Change Language:



AddThis Social Bookmark Button

A Django site.

Powered by Sphene Community Tools
Board » General » Managing user permissions

Hi!
I want to set specific permissions to my users, eg. allow user to lock threads in category as documentation says at: http://sct.sphene.net/wiki/show/Roles/. I can't find a proper way to do it. Is this functionality buggy?

I've noticed few things.
First, default sphboard template 'showThreads.html' uses:
{% if perms.post.change_post %}
    {% trans "Thread Options:" %} 
      {% if thread.allow_sticking %}

Is 'perms.post.change_post' correct? Shouldn't it be 'perms.sphboard.change_post'?

Second. in sphene/communitytools/models.py the model RoleMember is defined like:
class RoleMember(models.Model):
    """
    A role member is the relation between a given role and a 
    1.) user OR 2.) rolegroup - one of those two have to be null !

    This relation can have additional limitations - e.g. for the board
    it might only be active within one given category -
    see RoleMemberLimitation.

    If there are no limitations (has_limitations = False) then the role
    is active for the user globally within the role's group.
    """
    role = models.ForeignKey( Role )
    user = models.ForeignKey( User, null = True )
    rolegroup = models.ForeignKey( 'RoleGroup', null = True )

According to docstring, I think that there should be something like 'blank=True' in definition of user and rolegroup fields. Otherwise it is not possible to have one of them set to null (via Admin).

At last I did what I needed by creating new Role, then by adding new RoleMember (first, I had to add blank=True to RoleMember model) with specific user set.
you shouldn't use the django admin for role administration, just go to "/community/admin/permission/role/list/" and use that interface..

as for your first question.. i have to look into the code but don't have time right now, i'll let you know when i know more..
Hey, we have Signatures !!! Great, isn't it ? ;)
Herbert, I've sent you an e-mail message (25.11.2009) concerning this topic. Did you get it?
hi,
yes i got it. sorry for not replying, it has been quite busy lately.. i'll get to it this weekend at latest. i have to think which permissions would make the most sense on securing it. but you are right, it should be fixed asap :(

Hey, we have Signatures !!! Great, isn't it ? ;)
hi,
yes i got it. sorry for not replying, it has been quite busy lately.. i'll get to it this weekend at latest. i have to think which permissions would make the most sense on securing it. but you are right, it should be fixed asap :(
OK, I was just wondering if my e-mail was not classified as spam.
I think that 'community_manage_roles' permission might be used there.
sorry again for the late answer.

showThread.html:
you are right, that was a very very deprecated permission check .. i have exchanged it with:
  {% if thread.allow_sticking or thread.allow_locking or thread.allow_moving %}

which will take flag permissions into considerations ..

role permissions: i have added permission checks to the admin interface now :) (in svn trunk)


this should solve your current problems with permissions?
Hey, we have Signatures !!! Great, isn't it ? ;)

Please login to post a reply.



Powered by Sphene Community Tools