Mercurial > lada > lada-server
annotate src/main/java/de/intevation/lada/util/auth/Authorization.java @ 833:fa922101a462
Refactored Authorization.
* Introduced "authorizer"
* Attribute and datatype depended authorization
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 08 Jan 2016 12:05:26 +0100 |
parents | 8c336f08e76f |
children | 657f35a7467d |
rev | line source |
---|---|
711
3ec358698b4d
Code style and documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
604
diff
changeset
|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz |
3ec358698b4d
Code style and documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
604
diff
changeset
|
2 * Software engineering by Intevation GmbH |
3ec358698b4d
Code style and documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
604
diff
changeset
|
3 * |
3ec358698b4d
Code style and documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
604
diff
changeset
|
4 * This file is Free Software under the GNU GPL (v>=3) |
3ec358698b4d
Code style and documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
604
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
3ec358698b4d
Code style and documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
604
diff
changeset
|
6 * the documentation coming with IMIS-Labordaten-Application for details. |
3ec358698b4d
Code style and documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
604
diff
changeset
|
7 */ |
439
bcd43f47ac5d
Added stubs for authentication/authorization.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
8 package de.intevation.lada.util.auth; |
bcd43f47ac5d
Added stubs for authentication/authorization.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
9 |
578
f36a415c7052
Updated authorization interface and its default implemenation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
439
diff
changeset
|
10 import de.intevation.lada.util.rest.RequestMethod; |
f36a415c7052
Updated authorization interface and its default implemenation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
439
diff
changeset
|
11 import de.intevation.lada.util.rest.Response; |
439
bcd43f47ac5d
Added stubs for authentication/authorization.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
12 |
711
3ec358698b4d
Code style and documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
604
diff
changeset
|
13 /** |
3ec358698b4d
Code style and documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
604
diff
changeset
|
14 * Interface for authorization in the lada application. |
3ec358698b4d
Code style and documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
604
diff
changeset
|
15 * |
3ec358698b4d
Code style and documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
604
diff
changeset
|
16 * @author <a href="mailto:rrenkert@intevation.de">Raimund Renkert</a> |
3ec358698b4d
Code style and documentation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
604
diff
changeset
|
17 */ |
439
bcd43f47ac5d
Added stubs for authentication/authorization.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
18 public interface Authorization { |
578
f36a415c7052
Updated authorization interface and its default implemenation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
439
diff
changeset
|
19 public UserInfo getInfo(Object source); |
f36a415c7052
Updated authorization interface and its default implemenation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
439
diff
changeset
|
20 public <T> Response filter(Object source, Response data, Class<T> clazz); |
f36a415c7052
Updated authorization interface and its default implemenation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
439
diff
changeset
|
21 public <T> boolean isAuthorized( |
f36a415c7052
Updated authorization interface and its default implemenation.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
439
diff
changeset
|
22 Object source, Object data, RequestMethod method, Class<T> clazz); |
833
fa922101a462
Refactored Authorization.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
800
diff
changeset
|
23 //public <T> boolean isAuthorized(int id, Class<T> clazz); |
fa922101a462
Refactored Authorization.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
800
diff
changeset
|
24 public <T> boolean isAuthorized(UserInfo userInfo, Object data, Class<T> clazz); |
604
6c2921100b7f
Added method to check authorization with user infos and db object.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
578
diff
changeset
|
25 boolean isReadOnly(Integer probeId); |
439
bcd43f47ac5d
Added stubs for authentication/authorization.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
26 } |