Hi,
I've been trying to use Acegi ACL security but I got totally confused.
The ACL part in both acegi reference and spring in action is not clear enough(at least for me).
I already used acegi security for authentication and securing web requests and it's working fine.
But now I'm trying to use ACL to secure domain objects buI can't.
Here is a discription of my case. Hope someone could help me.
My application is so simple, it'a time attendance application.
I have 2 classe: Employee (which holds the employee data)
and Span (which holds the attendance information of the employees).
I have two types of employees (normal employees and managers).
Managers have more authorities than employees.
I have two ROLES in my application (ROLE_EMPLOYEE and ROLE_MANAGER).
The problem is:
I want to let each manager view the attendance information of a certain group of employees (the employees who work under his authority).
I don't want employees to see each other's data.
An employee can only view his own data.
A general manager can view the data of all employees and managers.
My classes are:
Employee:
Span:Code:private Long id; private String firstName; private String lastName; private String userName; private String secret; private Integer code; private String title; private Boolean isManager = new Boolean(false);
My DataBase consists of the following tables:Code:private Long id; private Employee employee; private String notes; private String ipAddress; private Date theDayDate; private Date startDate; private Date endDate; private Boolean isAuthorizable = new Boolean(false); private Date requestDate; private Date requestedStartDate; private Date requestedEndDate; private Employee manager;
Employee:
Span:Code:+-----------+------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-----------+------------------+------+-----+---------+----------------+ | id | int(10) unsigned | | PRI | NULL | auto_increment | | title | varchar(20) | YES | | NULL | | | firstName | varchar(100) | YES | MUL | NULL | | | lastName | varchar(100) | YES | | NULL | | | code | int(10) unsigned | | UNI | 0 | | | isManager | tinyint(1) | YES | | NULL | | | userName | varchar(255) | | MUL | | | | secret | varchar(255) | | | | | +-----------+------------------+------+-----+---------+----------------+
Employee Privileges:Code:+--------------------+------------------+------+-----+------------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------------+------------------+------+-----+------------+----------------+ | id | int(10) unsigned | | PRI | NULL | auto_increment | | employee | int(10) unsigned | | MUL | 0 | | | manager | int(10) unsigned | YES | MUL | NULL | | | isAuthorizable | tinyint(1) | | | 0 | | | theDayDate | date | | | 0000-00-00 | | | startDate | datetime | YES | | NULL | | | endDate | datetime | YES | | NULL | | | requestedStartDate | datetime | YES | | NULL | | | requestedEndDate | datetime | YES | | NULL | | | requestDate | datetime | YES | | NULL | | | notes | varchar(255) | YES | | NULL | | | ipAddress | varchar(255) | YES | | NULL | | +--------------------+------------------+------+-----+------------+----------------+
Code:+-----------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------+--------------+------+-----+---------+-------+ | userName | varchar(255) | | | | | | privilege | varchar(255) | | | | | +-----------+--------------+------+-----+---------+-------+
Sorry for this long message.
Hope someone could help me.
Thanks in Advance.
Sherihan.


epartment.