I don't understand what a practice with "Windows group" refers to. This says the following:
- Create a Windows group for each user.
- Add the Windows users to the corresponding group.
- Create a SQL Server login for each Windows group corresponding to a profile.
- Grant the necessary permissions to each Windows group.
- Create a standard role for each user profile
- Grant the necessary permissions to each role.
- Create a login for each application user and grant access to the database and its corresponding role.
I think I've already done steps 5-7, but I don't understand what you mean in the previous points.
This is what I have done:
USE master
GO
USE PRACT7
--Roles
CREATE ROLE Rol_Lector
CREATE ROLE Rol_Editor
CREATE ROLE Rol_Datos
CREATE ROLE Rol_Administrador
--Login
CREATE LOGIN Log_Juan WITH PASSWORD= '1234'
CREATE LOGIN Log_Pedro WITH PASSWORD= 'editor'
CREATE LOGIN Log_Roberto WITH PASSWORD= 'datos'
CREATE LOGIN Log_Juan_Manuel WITH PASSWORD= 'administrador'
DROP LOGIN Log_Juan
--Usuarios
CREATE USER Juan FOR LOGIN Log_Juan
CREATE USER Pedro FOR LOGIN Log_Pedro
CREATE USER Roberto FOR LOGIN Log_Roberto
CREATE USER Juan_Manuel FOR LOGIN Log_Juan_Manuel
--ASIGNACION roles
--CREATE ROLE Sales;
--ALTER ROLE Sales ADD MEMBER Barry;
--ALTER ROLE Sales DROP MEMBER Barry;
ALTER ROLE Rol_Lector ADD MEMBER Juan
ALTER ROLE Rol_Editor ADD MEMBER Pedro
ALTER ROLE Rol_Datos ADD MEMBER Roberto
ALTER ROLE Rol_Administrador ADD MEMBER Juan_Manuel
--Asignar permisos
GRANT SELECT
ON CAJEROS
TO Rol_Lector
GRANT DELETE, ALTER
ON CAJEROS
TO Rol_Editor
GRANT DELETE, ALTER, UPDATE, INSERT
ON CAJEROS
TO Rol_Datos
GRANT ALL PRIVILEGES
ON CAJEROS
TO Rol_Administrador
WITH GRANT OPTION