create new roles in sql server 2008 - sql-server

I have created a database system for a cms for a news website. I want to have only 4 roles in my db system : Admin, Author, Editor and Guest ( who only read the web pages). But there are some pre-defined roles in every db system like sys and db_owner and… and they are not removable but I want the only 4 roles I mentioned above. How can I aim this goal? thanks

ah, you cannot!
Also I do not think you will need to tweak the database system. Rather, architect a good solution for your application/frontend/website.

as far as i am aware, you can't modify those roles (besides adding logins to them). instead of working around them, you could try using them, it might make life a little bit easier.

Related

Unloading data from Views with minimal permissions

I'm a newbie to Snowflake. I'm assigned task to make python script that gets data from Snowflake View and copies it to SFTP server. I have barely any permissions on that account (can only view the shared Views).
Now my 2 questions:
Can admin grant me permission to creating internal stages without granting me any more permissions? (I want to ask the admin to give me that permission, but he won't be willing to share anything more with me.)
Can I use COPY INTO command on Views? All examples I read on the internet were about Tables and not Views and I'd like to be sure I can copy Views before asking for any permissions.
I apologize if those questions sound silly, but I have no way of testing those myself as I have no permissions on that account and I need to be sure before negotiating anything with admins.
Yes, that can be done. Also, you can look at the following documentation which details about Unload operation : docs.snowflake.com/en/user-guide/data-unload-overview.html

best way to implement laravel database system to manage posts read/share/edit permissions

Thank you for helping on this!
I am designing an app with documents and posts sharing with Laravel.
I tried to do it myself since two weeks but I am not sure what the best is.
I've tried implementing many packages and used crud generators, but as a Laravel beginner it's difficult to find the good package and to mix them.
What I want is a system like google docs sharing behaviour but for posts.
You could write a post and set it as
private
shared with those with the secret link
shared with users names list (or ids in database)
shared with groups of users
So what is the best way to build that?
1) Using a package? Which one?
2) table_users | table_posts | table_permissions
one permission per user that can read / edit (permission level)
3) table_users | table_posts including permissions for each posts
owner_id
share_link
users_that_can_read
users_that_can_edit
If anyone can direct me to a good tutorial or give me a good start structure for this tables to be efficient and secure.
Maybe I do not see all the complexity of this so I will enjoy any suggestions
The problem for this is I want a more flexible rights management than wordpress one that provides user rights levels, the availability of data will be managed by simple subscribers for a lot of things(files, posts, maybe comments, groups and maybe more stuff).
You just need to create three tables roles,permissions and roles_permission.The roles of the user goes in the table roles table.the permission of a user are stored in the table permission.You can map the roles and permission of a particular user in the roles_permission table.However,for more flexible way to add role-based-permission use entrust package.In which,you can dynamically add/update/delete the roles and permissions in laravel.

How can I protect our client database in either Windows or Access?

I started working for a company in the field service industry. We have a program and client database build in Access. As of right now, they are scheduling their service calls in a notebook. I am trying to get this company into this era by having a web-based scheduling software.
I have basic schooling networking but I am not a programmer nor do I know Access. I have learned how to split the database and create a multi-user environment and converted it to accdb from mdb to work with Access 2013 instead of 2003 in which it was written. These steps have greatly helped but I am not sure where to go from here.
My next step is the scheduling software but the company's greatest concern is the protection of their client database. Not from outside hackers but there is always a concern of employees selling our client list to our competitors. Also, at this time, employees do not have web access for this reason, which they will need.
Is there any way to keep the accdb file from being sent via email etc. or copied to external media? If I set up permissions through the OS, won't that make the client files uneditable (for lack of a better word) in Access? Like address/tele # changes or notes? I'm not even sure what to even search for help.
Thank in advance for your time
I understand that Access 2013 can be installed on a Server 2008 R2 or 2012 server. Put a password on the database. That should keep hackers out, and as far as keeping employees out of the data that they shoudn't be in, I know the navigation bar can be hidden, but it is unfortunately able to be viewed again by the F11 key. It would've been nice if MS could have made the navigation bar ability an easy option (yes or no), and make it modifyable in VBA....They may have. Keeping users out of raw data is something I have yet to figure out too....
I'm a novice at this stuff, but I was able to write code, and a login screen of my own so that users can have their own login ID, and a password (or phrase), and enable them to change their own password if they forget it, or if they just just to change it. You can make the navigation bar disappear by the VBA code: DoCmd.LockNavigationPane True...but unfortunately F11 can re-enable it.
Hope this helps....

How to locate user tables in another database for multisite-single-login

I am developing multi-sites with drupal.
I have to take care of 10 sites and they need single login
I supposed I need to create separate user database to support that
feature.
i.e 10 sites, 10 database and +1 user database.
Where should I look and modify? User Module? Which lines?
Normally database settings are in settings.php file .
I had export the database and make and working user-database already.
Please kindly try to explain in details thanks.
I don't know the full details of your situation but it sounds like you might benefit from one database with prefixed tables and a shared user table.
See
http://thedrupalblog.com/setting-multi-site-drupal-6-installation-shared-databases-and-single-sign and http://drupal.org/node/201673 (bit outdated but may still be helpful)

Web-App : Keeping trace of the version of the application in database?

We are building a webapp which is shipped to several client as a debian package. Each client runs his own server. But the update and support is done by us.
We make regular releases of the product, with a clean version number. Most of the users get an automatic update (by Puppet), some others don't.
We want to keep a trace of the version of the application (in order to allow the user to check the version in an "about" section, and for our support to help the user more accurately).
We plan to store the version of the code and the version of the base in our database, and to keep the info up to date automatically.
Is that a good idea ?
The other alternative we see is a file.
EDIT : The code and database schema are updated together. ( if we update to version x.y.z , both code and database go to x.y.z )
Using a table to track every change to a schema as described in this post is a good practice that I'd definitely suggest to follow.
For the application, if it is shipped independently of the database (which is not clear to me), I'd embed a file in the package (and thus not use the database to store the version of the web application).
If not and thus if both the application and the database versions are maintained in sync, then I'd just use the information stored in the database.
As a general rule, I would have both, DB version and application version. The problem here is how "private" is the database. If the database is "private" to the application, and user never modifies the schema then your initial solution is fine. In my experience, databases which accumulate several years of data stop being private, it means that users add a table or two and access data using some reporting tool; from that point on the database is not exclusively used by the application any more.
UPDATE
One more thing to consider is users (application) not being able to connect to the DB and calling for support. For this case it would be better to have version, etc.. stored on file system.
Assuming there are no compelling reasons to go with one approach or the other, I think I'd go with keeping them in the database.
I'd put them in both places. Then when running your about function you quickly check that they are both the same, and if they aren't you can display extra information about the version mismatch. If they're the same then you will only need to display one of them.
I've generally found users can do "clever" things like revert databases back to old versions by manually copying directories around "because they can" so defensively dealing with it is always a good idea.

Resources