Project

General

Profile

« Previous | Next » 

Revision 55ecdf3a

Added by Andreas Kohlbecker over 6 years ago

ref #6867 generic failsave mechanism to grant per entity permission in CdmPopupEditors

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/security/UserHelper.java
14 14

  
15 15
import eu.etaxonomy.cdm.model.common.CdmBase;
16 16
import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
17
import eu.etaxonomy.cdm.persistence.hibernate.permission.CdmAuthority;
17 18

  
18 19
/**
19 20
 * UserHelper interface. Implementations should use the {@link #VADDIN_SESSION_KEY} to auto registers
......
53 54

  
54 55
    boolean userIsAutheticated();
55 56

  
56
    public void createAuthorityFor(String username, CdmBase cdmEntity, EnumSet<CRUD> crud, String property);
57
    /**
58
     *
59
     * @param username
60
     * @param cdmEntity
61
     * @param crud
62
     * @param property
63
     * @return the newly created CdmAuthority only if a new CdmAuthority has been added to the user otherwise
64
     * <code>null</code> in case the operation failed of if the user was already granted with this authority.
65
     */
66
    public CdmAuthority createAuthorityFor(String username, CdmBase cdmEntity, EnumSet<CRUD> crud, String property);
57 67

  
58
    public void createAuthorityFor(String username, Class<? extends CdmBase> cdmType, Integer entitiyId, EnumSet<CRUD> crud, String property);
68
    /**
69
     *
70
     * @param username
71
     * @param cdmType
72
     * @param entitiyId
73
     * @param crud
74
     * @param property
75
     * @return the newly created CdmAuthority only if a new CdmAuthority has been added to the user otherwise
76
     * <code>null</code> in case the operation failed of if the user was already granted with this authority.
77
     */
78
    public CdmAuthority createAuthorityFor(String username, Class<? extends CdmBase> cdmType, Integer entitiyId, EnumSet<CRUD> crud, String property);
59 79

  
60 80
    /**
61 81
     * @param cdmType
62 82
     * @param entitiyId
63 83
     * @param crud
84
     * @return the newly created CdmAuthority only if a new CdmAuthority has been added to the user otherwise
85
     * <code>null</code> in case the operation failed of if the user was already granted with this authority.
64 86
     */
65
    void createAuthorityForCurrentUser(Class<? extends CdmBase> cdmType, Integer entitiyId, EnumSet<CRUD> crud, String property);
87
    public CdmAuthority createAuthorityForCurrentUser(Class<? extends CdmBase> cdmType, Integer entitiyId, EnumSet<CRUD> crud, String property);
66 88

  
67 89
    /**
68 90
     * @param cdmType
69 91
     * @param entitiyId
70 92
     * @param crud
93
     * @return the newly created CdmAuthority only if a new CdmAuthority has been added to the user otherwise
94
     * <code>null</code> in case the operation failed of if the user was already granted with this authority.
95
     */
96
    public CdmAuthority createAuthorityForCurrentUser(CdmBase cdmEntity, EnumSet<CRUD> crud, String property);
97

  
98
    /**
99
     * @param newAuthority
100
     */
101
    public void removeAuthorityForCurrentUser(CdmAuthority newAuthority);
102

  
103
    /**
104
     * @param username
105
     * @param newAuthority
71 106
     */
72
    void createAuthorityForCurrentUser(CdmBase cdmEntity, EnumSet<CRUD> crud, String property);
107
    public void removeAuthorityForCurrentUser(String username, CdmAuthority newAuthority);
73 108

  
74 109

  
75 110
}

Also available in: Unified diff