Commit Graph

35 Commits

Author SHA1 Message Date
Robert von Burg 5dc94514e1 [Major] Added persisting of sessions 2015-10-16 17:21:26 +02:00
Robert von Burg 0c7315b713 [Major] SystemUserAction is now a normal privilege
which is added as follows:
<Privilege name="ch.eitchnet.privilege.handler.SystemUserAction" 
    policy="DefaultPrivilege">
  <Allow>ch.eitchnet.privilege.test.model.TestSystemUserAction</Allow>
  <Deny>ch.eitchnet.privilege.test.model.TestSystemUserActionDeny</Deny>
</Privilege>
2015-06-03 23:25:30 +02:00
Robert von Burg 4c6434f475 [Major] Setting user password, locale and state are now separate privs 2015-04-05 00:13:16 +02:00
Robert von Burg 9870513beb [New] Added new param "privilegeConflictResolution"
- privilegeConflictResolution is used to configure how conflicts of
privileges on multiple roles are handled.
- Implemented is STRICT where if a privilege with the same name exists
on a role used by the same user occurs, then an exception is thrown.
- Next is MERGE where if a conflict occurs, then the privileges are
merged: allAllowed overrides, allow and deny list are merged
2015-03-14 00:18:59 +01:00
Robert von Burg fa40671b8c [Major] removed the need for a role PrivilegeAdmin - now use privileges
- this solves the situation where a user might be allowed to add a user
with a specific role, but not change a role and other such use cases

Now there are privileges for every use case with two new
PrivilegePolicies:
- RoleAccessPrivilege
- UserAccessPrivilege
both of these policies expect a ch.eitchnet.utils.collections.Tuple as
privilege value. The Tuple is a simple wrapper for two values: first and
second. Each privilege has its own requirement on the actual values

Special privilege actions:
- PrivilegeAction -> privilege vlaue: String
  - Persist (required Allow)
  - Reload (required Allow)
  - GetPolicies (required Allow)

Role specific privileges:
- PrivilegeGetRole -> privilege value: Tuple(null, newRole)
- PrivilegeAddRole -> privilege value: Tuple(null, newRole)
- PrivilegeRemoveRole -> privilege value: Tuple(null, newRole)
- PrivilegeModifyRole -> privilege value: Tuple(oldRole, newRole)

Use specific privileges:
- PrivilegeGetUser -> privilege value: Tuple(null, newUser)
- PrivilegeAddUser -> privilege value: Tuple(null, newUser)
- PrivilegeRemoveUser -> privilege value: Tuple(null, newUser)
- PrivilegeModifyUser -> privilege value: Tuple(oldUser, newUser)
  - NOTE: without modifying roles, only fields and properties!
- PrivilegeAddRoleToUser -> privilege value: Tuple(oldUser, roleName)
- PrivilegeRemoveRoleFromUser -> privilege value: Tuple(oldUser,
	roleName)
2015-03-12 17:32:06 +01:00
Robert von Burg a3d76d4cd8 [Major] allow user to change their own locale incl. auto persist 2015-03-08 21:44:21 +01:00
Robert von Burg 5940a345d4 [Major] refactoring Privilege
- All reps are now JAXB enabled
- replaced addOrReplace with add and repalace methods
- added some more tests
2015-03-08 13:38:15 +01:00
Robert von Burg d2faed1d2e [Major] added firstname and lastname to certificate
Also renamed model attribute from surname to lastname
2014-08-22 20:36:18 +02:00
Robert von Burg 2e1412de93 [Major] Removed the use of a ThreadLocal for the PrivilegeContext
ThreadLocals are bad idea when ClassLoaders come into play, so removing
the need makes Privilege better usable in different contexts.
2014-04-15 19:18:11 +02:00
Robert von Burg 5d59a52eeb [Minor] Throwing explicit exception system user tries to login
Further enforcing that a system user may not have a password
2013-12-28 10:55:58 +01:00
Robert von Burg 036c725a52 [Project] Changed all licence references to Apache License 2.0 2013-12-15 13:38:29 +01:00
Robert von Burg 01884029b8 [Minor] removed unused file config/Model.xml 2013-11-15 18:44:55 +01:00
Robert von Burg 93022ba559 [Major] major rewrite of the privilege validation.
Now the PrivilegeContext object is central and once the user logged in,
this object is bound to a ThreadLocal. From then there is no further
need to interact with the PrivilegeHandler - this allows for
authenticated users to get a remote copy of the PrivilegeContext so that
on a remote client, the user can check for permissions, without having
to do the round trip to the server.

A code review of this change would be good, but preliminary tests show
that it works. A test should now be implemented to check if getting a
remote copy also allows for authorization.
2013-04-09 07:33:32 +02:00
Robert von Burg e76d9f9121 Implemented XML parsing and writing by using basic Java implementation 2013-01-20 21:26:18 +01:00
Robert von Burg 28a60b52f7 [New] implemented auto persist on password change
Through configuration option it is now possible to enable automatic
persisting after password change, no matter who the user is.
2012-12-01 00:06:54 +01:00
Robert von Burg 8b780368d7 [Devel] implementing PrivilegeHandler.runAsSystem()
Implementing the runAsSystem() so that special actions can be performed,
where no user is logged in

Refactored the test classes so that model specific classes are in the
model sub package.
2012-08-05 01:33:54 +02:00
Robert von Burg bb515756cb [New] Changed Privilege Users to have a map of properties with which
meta data of a user can be stored. This can be used for validationg
privileges on user specific data
2011-08-07 16:00:38 +02:00
eitch bef87b1a18 [Minor] code comments cleanup, added LGPL reference and copyright notice 2011-08-07 10:14:40 +00:00
eitch 4c455c130a 2011-07-31 15:18:29 +00:00
eitch 8b9c8ea1e5 [Major] refactored the use of the Privilege class, now Roles have Privileges in a composition relationship 2011-07-30 13:20:08 +00:00
eitch f26013583d [Interface] modified privilege to have only two configuration files: Privilege.xml for the configuration for the handlers and Policies. and PrivilegeModel.xml for the configuration of the run time modifiable data (roles, users, privileges) 2011-07-28 20:50:35 +00:00
eitch 1d410a6ede 2010-09-18 20:13:31 +00:00
eitch c5fe322c5f 2010-09-18 20:03:09 +00:00
eitch 28f1e4a662 2010-08-02 23:20:54 +00:00
eitch 57f0164e38 2010-07-14 21:26:52 +00:00
eitch f491dd7293 2010-06-20 20:13:58 +00:00
eitch dc414218e6 2010-06-05 21:06:03 +00:00
eitch ddb1aa279a - remodelled privilege to be its own object and put all models into the persistence handler 2010-06-03 20:37:00 +00:00
eitch 152d58d515 2010-05-31 21:55:52 +00:00
eitch 756ae1e3e9 2010-05-31 21:44:15 +00:00
eitch 0775f52b0c 2010-05-31 19:34:26 +00:00
eitch 89e4f30bcf 2010-05-30 19:28:39 +00:00
eitch 00ed10014d 2010-05-29 22:32:53 +00:00
eitch d4f471028e 2010-05-29 19:11:28 +00:00
eitch 4d46267b1d 2010-05-25 21:15:35 +00:00