Ask Your Question
1

Specific user permission

asked 2013-05-02 23:39:42 -0600

pol0nium gravatar image

Hi,

I would like to do two things : First, making everyone unable of marking an answer as correct. Then, creating an user which is capable of marking an answer as correct only if a specific tag is present in the post.

Is such a thing possible? If so, where should I implement it?

Thanks in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-05-03 22:12:02 -0600

Evgeny gravatar image

updated 2013-05-04 01:10:26 -0600

Permissions are checked by assertions defined in askbot/models/__init__.py - see methods named user_assert_can_X, where X is some action.

There is no support for the specific feature you are asking about in Askbot, you will have to either for askbot or we can figure out a way to create either signals or other hooks that make this possible by configuration.

IMO, if you limit your user's ability to accept answers this way you might risk not getting any accepted answers, because this rule might be difficult for the users to understand (we could work on implementing definition for the specific permissions).

edit flag offensive delete link more

Comments

Let's imagine I want to create a garage askbot forum. I want to create one user who will provide answers for "Ford" cars, one who will provide answers for "Renault" cars and one who will provide answers for "Bmw" cars. If I have such users, I'll assume they'll always give the best response and I want to highlight their answers. For this I see two possibilities : - automatically mark the answer as correct OR - set the answer background of a specific color.

What do you think about that? I think the background color is the better idea. How to add the feature?

Thanks !

pol0nium gravatar imagepol0nium ( 2013-05-03 22:28:45 -0600 )edit

What if this permission would be earnable for example via a badge? E.g. "BWW expert" - someone who answered x questions tagged BMW and collected y upvotes or something like that?

Evgeny gravatar imageEvgeny ( 2013-05-04 00:30:41 -0600 )edit

The idea is to define someone as the only BMW expert and make all his posts appear in a specific color.

pol0nium gravatar imagepol0nium ( 2013-05-04 00:33:59 -0600 )edit

How do you know what is the people's expertise without them showing it to you? We can think of some points which allow you to implement custom features. At this point I am more interested in making software really stable and polished and more easily customizable rather than adding lot's of new built-in features.

Evgeny gravatar imageEvgeny ( 2013-05-04 00:38:47 -0600 )edit

If the guy is a member of my team (if I know him in real life!), then I know that he is an expert because I'm the admin and I decided it (with great power comes great responsibility)! So my goal is to highlight all his answers. Your idea about custom badge is great. I can define a custom badge without any rule to earn it and give him the badge manually through the admin panel.

So now, let's assume I have this badge. Is there a function like this : user_has_badge(badgename) ? I'd use such a function to test if I need to set a background in my template or not.

pol0nium gravatar imagepol0nium ( 2013-05-04 00:43:21 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-05-02 23:39:42 -0600

Seen: 185 times

Last updated: May 04 '13