First time here? Check out the FAQ!
1

Specific user permission

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.

pol0nium's avatar
1
pol0nium
asked 2013-05-02 23:39:42 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

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).

Evgeny's avatar
13.2k
Evgeny
answered 2013-05-03 22:12:02 -0500, updated 2013-05-04 01:10:26 -0500
edit flag offensive 0 remove flag delete link

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's avatar pol0nium (2013-05-03 22:28:45 -0500) 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's avatar Evgeny (2013-05-04 00:30:41 -0500) edit

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

pol0nium's avatar pol0nium (2013-05-04 00:33:59 -0500) 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's avatar Evgeny (2013-05-04 00:38:47 -0500) 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's avatar pol0nium (2013-05-04 00:43:21 -0500) edit
add a comment see more comments