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 » Feature Discussions » Advanced permissions (for the board)

Page: Previous 1 2 3 Next

No, the system you described will be perfect for our uses here. I'm looking forward to it! Thanks again, Herbert.
"Never quote yourself" -- Daniel Ellison
i have now committed a first version of these role permissions ...
it also contains a very simple administration .. you can link it by including the following code in your base template:
{% if sph_perms.community_manage_roles %}
  		<a href="{% sph_url 'community_admin_permission_role_list' %}">Manage Roles</a><br/>
{% endif %}


(which basically links to /community/admin/permission/role/list/ by default)

there you can add and edit roles - assign permission flags .. and add members (users)

most things should already work .. it would be nice if you could try it yourself if you have time :)

(there are still a couple of things left to do for me anyway .. e.g. securing the role administration views, writing documentation and better testing - so it's still not 100% finished)
Hey, we have Signatures !!! Great, isn't it ? ;)
Thanks a lot, Herbert! I'll trying it out as soon as I can. I appreciate your effort.
"Never quote yourself" -- Daniel Ellison
Hey, Herbert. Just a couple of things. When I try to add an existing user to a role using your form, I get this:
(Hidden field auto_submit) This field is required.
I can add users to roles using the Django admin with no problem, however. One advantage to using the Django form is that I don't need to know the username; I can choose from a list. This might not work on the long run though, as the site I'm working on has almost 200,000 registered users.

Another problem comes up when I click on "Roles" in the Community section of the Django admin. I get:
OperationalError at /admin/community/role/
no such column: community_group.id
Thanks!
"Never quote yourself" -- Daniel Ellison
Daniel Ellison said @ 2007-09-04 20:23:47:
When I try to add an existing user to a role using your form, I get this:
(Hidden field auto_submit) This field is required.

oops sorry .. i first coded the general 'add user to a role' feature, and than added the 'has limitation' .. and then forgot to test the general functionality agian .. this obviously broke it :( - i'll fix that tomorrow ..

Daniel Ellison said @ 2007-09-04 20:23:47:
I can add users to roles using the Django admin with no problem, however. One advantage to using the Django form is that I don't need to know the username; I can choose from a list.

well.. i wanted to focus on functionality right now.. it shouldn't be too hard to later add a nice auto complete feature, a user search or some other javascript crazyness :)

Daniel Ellison said @ 2007-09-04 20:23:47:
Another problem comes up when I click on "Roles" in the Community section of the Django admin. I get:
OperationalError at /admin/community/role/
no such column: community_group.id
Thanks!

weird, it works for me.. do you have a table called 'community_group' .. with an id column ? (i would be quite shocked if not)
can you try a "./manage.py sql community" and look how the community_group table would look like ?

i can't imagine how there could be a missing id column .. all django tables (that i'm using) have id tables ..
Hey, we have Signatures !!! Great, isn't it ? ;)
Hey, no problem about adding users. As I mentioned, there are almost 200,000 users so a list wouldn't really work anyway. As for the other error, it looks like the table's being created properly:
CREATE TABLE "community_group" (
    "id" integer NOT NULL PRIMARY KEY,
    "name" varchar(250) NOT NULL,
    "longname" varchar(250) NOT NULL,
    "default_theme_id" integer NULL REFERENCES "community_theme" ("id"),
    "parent_id" integer NULL,
    "baseurl" varchar(250) NOT NULL
);
Odd! I'll try starting from scratch again and see what happens.
"Never quote yourself" -- Daniel Ellison
Hi Herbert. I'm still getting that error when I click on "Roles" in the Django admin. That's on two machines, one running the Django dev server with sqlite3 and the other running Apache/MySQL.

Also, another, more serious issue has come up. Whenever we try to post a new thread we get an error, claiming we're trying to import a request object. This is what I get on the Django dev server:
__import__() argument 1 must be string, not WSGIRequest
And this is what I get on Apache/MySQL:
__import__() argument 1 must be string, not ModPythonRequest
(ignoring the "create:" of course). This is with the latest revision on the sct trunk. Hopefully it's a minor problem. I'm looking into it myself, but maybe you know a quick fix for it. I'm hoping, anyway. :)
"Never quote yourself" -- Daniel Ellison
weird, i haven't seen that problem before.. i'll check it once i'm at home.. (if you don't find it earlier ;) )
Hey, we have Signatures !!! Great, isn't it ? ;)
Thanks, Herbert! I appreciate your attention to this. The error also happens on a completely different install of the tools. This install has nothing to do with our current project.
"Never quote yourself" -- Daniel Ellison
A bit more info: the posts do get into the database despite the error. The only problem is, they don't show up when their link is clicked. It just goes right back to the list. It seems that the problem is on line 253 of sphboard.views. Here's the stack trace:
Traceback (most recent call last):
File "/home/rachael/lib/django/django/core/handlers/base.py" in get_response
  77. response = callback(request, *callback_args, **callback_kwargs)
File "/home/rachael/lib/sphene/communitytools/sphenecoll/sphene/sphboard/views.py" in post
  253. return HttpResponseRedirect( thread.get_absolute_url() )
File "/home/rachael/lib/django/django/utils/functional.py" in _curried
  3. return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs))
File "/home/rachael/lib/django/django/db/models/base.py" in get_absolute_url
  464. return settings.ABSOLUTE_URL_OVERRIDES.get('%s.%s' % (opts.app_label, opts.module_name), func)(self)
File "/home/rachael/lib/sphene/communitytools/sphenecoll/sphene/community/sphpermalink.py" in inner
  26. return reverse(bits0, urlconf, *bits[1:3])
File "/home/rachael/lib/django/django/core/urlresolvers.py" in reverse
  296. return iri_to_uri(u'/' + get_resolver(urlconf).reverse(viewname, *args, **kwargs))
File "/home/rachael/lib/django/django/core/urlresolvers.py" in reverse
  281. if lookup_view in self.reverse_dict:
File "/home/rachael/lib/django/django/core/urlresolvers.py" in _get_reverse_dict
  215. if not self._reverse_dict and hasattr(self.urlconf_module, 'urlpatterns'):
File "/home/rachael/lib/django/django/core/urlresolvers.py" in _get_urlconf_module
  251. self._urlconf_module = __import__(self.urlconf_name, {}, {}, [''])

  TypeError at /club/board/post/39/
  __import__() argument 1 must be string, not ModPythonRequest
I guess it makes sense that the links don't work as it looks like it's the absolute URL that is screwing up.
"Never quote yourself" -- Daniel Ellison

Page: Previous 1 2 3 Next

Please login to post a reply.



Powered by Sphene Community Tools