Adding role and assigning permission

A place to discuss and receive support for the Web Auction application.

Adding role and assigning permission

Postby imransayedxl » Mon Oct 22, 2012 8:34 am

I want to edit the role names and add a new role. I want to rename 'User' as 'Buyer' and add a new role 'Seller'. The roles for 'Buyer' remains the same as 'User', and 'Admin' remains as Admin. Now the tough part of what I want:
1) In User registration, the roles should have Buyer & Seller
2) The person who selects 'Buyer' gets User rights
3) Admin role is not seen in the form
4) The person who selects 'Seller' gets partial admin rights of Adding a Product.
5) He cannot see 'Add New Category' & 'Auction Settings' link or it is disabled for him
6) He can only view records of his products posted

Please let me know if this can be done and how :?: Thanks in advance.
imransayedxl
 
Posts: 1
Joined: Mon Oct 22, 2012 8:26 am

Re: Adding role and assigning permission

Postby shannah » Fri Oct 26, 2012 7:56 am

This can be done, but it would require some modifications to the permissions on the products table. It would probably also require some careful testing of the application in general to make sure nothing breaks as a result of adding a new role.

I would recommend leaving the Buyer role as user in the database, then assign a custom valuelist to the field where the keys correspond with the values in the ENUM for role and the values would have whatever the actual role is.

e.g. valuelists.ini
Code: Select all
[roles]
    USER=BUYER
    SELLER=SELLER
    ADMIN=ADMIN


You would also need to modify the ENUM in the users table definition to add SELLER as an option.

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Web Auction Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved