How to give super user privileges for the existing user in postgresql - postgresql-9.1

How to create super user for the existing user in postgresql, i want to give the super user permission for the abc user, now this user has only create DB rights only, i want give as super user anybody help me.

Per the manual:
ALTER USER the_user SUPERUSER;

Related

How to give the privilege of giving privileges in Oracle

I want to create an application about one user select other users and define there privileges, but this user don't be a Administrator or "dba". A sentence as:
GRANT GRANT TO BIG_USER;
The "Big User" have many privileges, another users the same or less.
Thanks
If you want to grant all grant that have been given to a user to some other users at first you should get that user grants then for each user write a script to give that grant. the following tables show the grant for each user
USER_SYS_PRIVS, USER_TAB_PRIVS, USER_ROLE_PRIVS tables
write a query to get privileges and then give them to other users
Oracle's permission system allows a bit of granularity regarding what you can allow this user to grant.
For objects (tables, etc) you have to either be a dba, the object owner, or have permissions granted with the grant option. So the following should work:
GRANT ALL PRIVILEGES ON mytable TO WITH GRANT OPTION;
You would have to repeat this on every table the user needs to be able to manage permissions on.
This answer is assuming you are looking at permissions on objects (tables etc) rather than system privileges.

ASP.net Identity 2.0, how to delete user but restrict username from being used again?

I have a site using ASP.net identity 2.0 for user management with a few external authentication options as well (google,facebook,etc).
I want to give users the option to delete their account. I found a good example of how to implement this in this answer: ASP.NET MVC 5 how to delete a user and its related data in Identity 2.0
However, I am looking to restrict anyone else from registering the old user's username when he/she delete their account. However, the email should be freed up if they decide to reregister.
I want to prevent user ABC from deleting their account, and then someone unrelated taking username ABC (this would cause confusion/problems in my use case).
I am looking for advice on best practices on how to implement this. Is there anything built into ASP identity? Or should I keep a list/sql db somewhere of all registered usernames (deleted and active) and simply check new users against this list?
Thank you.
A hyper simplistic approach would be to simply not delete the user account in the user tables but rather mark it as locked and update the email address from whatever it is to something else and set whatever other sensitive fields like passwords to in-house defaults. You'd probably want to reduce and or outright delete any rights / roles too.
So do a replace on an email account of abc#abc.com to make it abc#abc.com#deletedaccount.me.
Then you're done and dont need any extra coding as the framework will take care of the rest itself.

How to do not allow a user to create another user with one role in Drupal?

I have a user with the role 'manager'. This user can administer other users, so he can create users. In my system I have two other roles, 'representant' and 'client'. The 'representant' can create users too, but my trouble is that he can create 'manager' users. I want to allow 'representant's to create only other 'representant's and 'client's.
How can I do this? There is some Drupal module that treats this problem?
Thank you.
the Administer Users by Role module might do.
The User Creator module appears to do what you're looking for.

Membership user is not found after UserName was changed

Help please if you know how.
I'm using Membership but allow to change UserName of specified user.
I had user named Customer bound to role Customer, and then his username was changed to 123.
Then i try to do something to get Roles of this user and get an error or empty result.
Roles.RemoveUserFromRoles(UserName, Roles.GetAllRoles()); // get exception - user 123 does not exist
String[] userRoles = Roles.GetRolesForUser(UserName); // returns String[]{0}
Then i went to IIS manager panel and saw that selected role still has renamed user but renamed user was not added to any role.
DB table UserInRoles (which set the link between User and Role) has relevant record and all UserIDs and RoleIDs are correct.
So i do not understand if all links in DB connected within IDs, why after i changed UserName this link was broken?
I will appreciate any help, advices and information.
Thanks, Art
Well, Membership sucks - this is the answer i will never use it anymore in any project. This is the answer.
Workaround for question above is to create your own methods to edit user by ID.

Where does Drupal store user permissions in the database?

Does anyone know where Drupal stores, in the Database, the role of a user? It's not in the users table, and I can't seem to find it. I can find where it defines the role, defines the role's permissions, but I can't find where it defines what Role a certain User is. Anyone know? Thanks!
For Drupal 6 it's in the users_roles table, which associates a users user record (via uid) with a role role record (via rid).
The direct table it stores permissions in is role_permission.

Resources