mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 00:45:44 +01:00
javadoc
This commit is contained in:
@@ -45,6 +45,7 @@ import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
/**
|
||||
* Permission object which is assigned to a specific user or group.
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
* @since 1.31
|
||||
@@ -54,7 +55,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||
public class AssignedPermission implements PermissionObject, Serializable
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
/** serial version uid */
|
||||
private static final long serialVersionUID = -7411338422110323879L;
|
||||
|
||||
//~--- constructors ---------------------------------------------------------
|
||||
@@ -66,10 +67,10 @@ public class AssignedPermission implements PermissionObject, Serializable
|
||||
public AssignedPermission() {}
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
* Constructs a new AssignedPermission.
|
||||
*
|
||||
*
|
||||
* @param permission
|
||||
* @param permission assigned permission
|
||||
*/
|
||||
public AssignedPermission(AssignedPermission permission)
|
||||
{
|
||||
@@ -79,11 +80,11 @@ public class AssignedPermission implements PermissionObject, Serializable
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
* Constructs a new AssingnedPermmission.
|
||||
*
|
||||
*
|
||||
* @param name
|
||||
* @param permission
|
||||
* @param name name of the user
|
||||
* @param permission permission string
|
||||
*/
|
||||
public AssignedPermission(String name, String permission)
|
||||
{
|
||||
@@ -92,12 +93,12 @@ public class AssignedPermission implements PermissionObject, Serializable
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
* Constructs a new AssingnedPermmission.
|
||||
*
|
||||
*
|
||||
* @param name
|
||||
* @param groupPermission
|
||||
* @param permission
|
||||
* @param name name of the user or group
|
||||
* @param groupPermission true if the permission should be assigned to a group
|
||||
* @param permission permission string
|
||||
*/
|
||||
public AssignedPermission(String name, boolean groupPermission,
|
||||
String permission)
|
||||
@@ -110,12 +111,7 @@ public class AssignedPermission implements PermissionObject, Serializable
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param obj
|
||||
*
|
||||
* @return
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
@@ -138,10 +134,7 @@ public class AssignedPermission implements PermissionObject, Serializable
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public int hashCode()
|
||||
@@ -150,10 +143,7 @@ public class AssignedPermission implements PermissionObject, Serializable
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
@@ -170,10 +160,10 @@ public class AssignedPermission implements PermissionObject, Serializable
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
* Returns the name of the user or group which the permission is assigned.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
* @return name of user or group
|
||||
*/
|
||||
@Override
|
||||
public String getName()
|
||||
@@ -182,10 +172,10 @@ public class AssignedPermission implements PermissionObject, Serializable
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
* Returns the string representation of the permission.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
* @return string representation of the permission
|
||||
*/
|
||||
public String getPermission()
|
||||
{
|
||||
@@ -193,10 +183,10 @@ public class AssignedPermission implements PermissionObject, Serializable
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
* Returns true if the permission is assigned to a group.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
* @return true if the permission is assigned to a group
|
||||
*/
|
||||
@Override
|
||||
public boolean isGroupPermission()
|
||||
@@ -206,13 +196,13 @@ public class AssignedPermission implements PermissionObject, Serializable
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
/** group permission indicator */
|
||||
@XmlElement(name = "group-permission")
|
||||
private boolean groupPermission;
|
||||
|
||||
/** Field description */
|
||||
/** name of the user or group */
|
||||
private String name;
|
||||
|
||||
/** Field description */
|
||||
/** string representation of the permission */
|
||||
private String permission;
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
/**
|
||||
* Descriptor for available permission objects.
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
* @since 1.31
|
||||
@@ -84,12 +85,7 @@ public class PermissionDescriptor implements Serializable
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param obj
|
||||
*
|
||||
* @return
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
@@ -112,10 +108,7 @@ public class PermissionDescriptor implements Serializable
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public int hashCode()
|
||||
@@ -124,10 +117,7 @@ public class PermissionDescriptor implements Serializable
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
@@ -146,10 +136,10 @@ public class PermissionDescriptor implements Serializable
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
* Returns the description of the permission.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
* @return description
|
||||
*/
|
||||
public String getDescription()
|
||||
{
|
||||
@@ -157,10 +147,10 @@ public class PermissionDescriptor implements Serializable
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
* Returns the display name of the permission.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
* @return display name
|
||||
*/
|
||||
public String getDisplayName()
|
||||
{
|
||||
@@ -168,10 +158,10 @@ public class PermissionDescriptor implements Serializable
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
* Returns the string representation of the permission.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
* @return string representation
|
||||
*/
|
||||
public String getValue()
|
||||
{
|
||||
@@ -180,13 +170,13 @@ public class PermissionDescriptor implements Serializable
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
/** description */
|
||||
private String description;
|
||||
|
||||
/** Field description */
|
||||
/** display name */
|
||||
@XmlElement(name = "display-name")
|
||||
private String displayName;
|
||||
|
||||
/** Field description */
|
||||
/** value */
|
||||
private String value;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
package sonia.scm.security;
|
||||
|
||||
/**
|
||||
* Interface for permission objects.
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
* @since 1.31
|
||||
@@ -40,18 +41,18 @@ public interface PermissionObject
|
||||
{
|
||||
|
||||
/**
|
||||
* Method description
|
||||
* Returns the name of the user or group which the permission is assigned.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
* @return name of user or group
|
||||
*/
|
||||
public String getName();
|
||||
|
||||
/**
|
||||
* Method description
|
||||
* Returns the id of the stored permission object.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
* @return id of permission
|
||||
*/
|
||||
public boolean isGroupPermission();
|
||||
}
|
||||
|
||||
@@ -35,13 +35,12 @@ package sonia.scm.security;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
|
||||
import org.apache.shiro.subject.PrincipalCollection;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* The SecuritySystem manages global permissions.
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
* @since 1.31
|
||||
@@ -50,84 +49,76 @@ public interface SecuritySystem
|
||||
{
|
||||
|
||||
/**
|
||||
* Method description
|
||||
* Store a new permission.
|
||||
*
|
||||
*
|
||||
* @param permission
|
||||
* @param permission permission to be stored
|
||||
*
|
||||
* @return
|
||||
* @return stored permission
|
||||
*/
|
||||
public StoredAssignedPermission addPermission(AssignedPermission permission);
|
||||
|
||||
/**
|
||||
* Method description
|
||||
* Delete stored permission.
|
||||
*
|
||||
*
|
||||
* @param permission
|
||||
* @param permission permission to be deleted
|
||||
*/
|
||||
public void deletePermission(StoredAssignedPermission permission);
|
||||
|
||||
/**
|
||||
* Method description
|
||||
* Delete stored permission.
|
||||
*
|
||||
*
|
||||
* @param id
|
||||
* @param id id of the permission
|
||||
*/
|
||||
public void deletePermission(String id);
|
||||
|
||||
/**
|
||||
* Method description
|
||||
* Modify stored permission.
|
||||
*
|
||||
*
|
||||
* @param id
|
||||
* @param permission
|
||||
* @param permission stored permisison
|
||||
*/
|
||||
public void modifyPermission(StoredAssignedPermission permission);
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
* Return all stored permissions.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
* @return stored permission
|
||||
*/
|
||||
public List<StoredAssignedPermission> getAllPermissions();
|
||||
|
||||
/**
|
||||
* Method description
|
||||
* Return all available permissions.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
* @return available permissions
|
||||
*/
|
||||
public List<PermissionDescriptor> getAvailablePermissions();
|
||||
|
||||
/**
|
||||
* Method description
|
||||
* Return the stored permission which is stored with the given id.
|
||||
*
|
||||
*
|
||||
* @param id
|
||||
* @param id id of the stored permission
|
||||
*
|
||||
* @return
|
||||
* @return stored permission
|
||||
*/
|
||||
public StoredAssignedPermission getPermission(String id);
|
||||
|
||||
/**
|
||||
* Method description
|
||||
* Returns all stored permissions which are matched by the given
|
||||
* {@link Predicate}.
|
||||
*
|
||||
*
|
||||
* @param predicate
|
||||
* @param predicate predicate to filter
|
||||
*
|
||||
* @return
|
||||
* @return filtered permissions
|
||||
*/
|
||||
public List<StoredAssignedPermission> getPermissions(
|
||||
Predicate<AssignedPermission> predicate);
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public PrincipalCollection getSystemAccount();
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
/**
|
||||
* Permission object which is stored and assigned to a specific user or group.
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
* @since 1.31
|
||||
@@ -47,7 +48,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||
public class StoredAssignedPermission extends AssignedPermission
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
/** serial version uid */
|
||||
private static final long serialVersionUID = -4593919877023168090L;
|
||||
|
||||
//~--- constructors ---------------------------------------------------------
|
||||
@@ -59,11 +60,11 @@ public class StoredAssignedPermission extends AssignedPermission
|
||||
public StoredAssignedPermission() {}
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
* Constructs a new StoredAssignedPermission.
|
||||
*
|
||||
*
|
||||
* @param id
|
||||
* @param permission
|
||||
* @param id id of the permission object
|
||||
* @param permission assigned permission object
|
||||
*/
|
||||
public StoredAssignedPermission(String id, AssignedPermission permission)
|
||||
{
|
||||
@@ -75,10 +76,10 @@ public class StoredAssignedPermission extends AssignedPermission
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
* Returns the id of the stored permission object.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
* @return id of permission
|
||||
*/
|
||||
public String getId()
|
||||
{
|
||||
@@ -87,6 +88,6 @@ public class StoredAssignedPermission extends AssignedPermission
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
/** id */
|
||||
private String id;
|
||||
}
|
||||
|
||||
@@ -42,6 +42,8 @@ import sonia.scm.HandlerEvent;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Event which is fired after a {@link StoredAssignedPermission} was added,
|
||||
* removed or changed.
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
* @since 1.31
|
||||
@@ -49,17 +51,17 @@ import java.io.Serializable;
|
||||
public final class StoredAssignedPermissionEvent implements Serializable
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
/** serial version uid */
|
||||
private static final long serialVersionUID = 706824497813169009L;
|
||||
|
||||
//~--- constructors ---------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
* Constructs a new StoredAssignedPermissionEvent.
|
||||
*
|
||||
*
|
||||
* @param type
|
||||
* @param permission
|
||||
* @param type type of the event
|
||||
* @param permission permission object which has changed
|
||||
*/
|
||||
public StoredAssignedPermissionEvent(HandlerEvent type,
|
||||
StoredAssignedPermission permission)
|
||||
@@ -71,12 +73,7 @@ public final class StoredAssignedPermissionEvent implements Serializable
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param obj
|
||||
*
|
||||
* @return
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
@@ -99,10 +96,7 @@ public final class StoredAssignedPermissionEvent implements Serializable
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public int hashCode()
|
||||
@@ -111,10 +105,7 @@ public final class StoredAssignedPermissionEvent implements Serializable
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
@@ -130,10 +121,10 @@ public final class StoredAssignedPermissionEvent implements Serializable
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
* Return the type of the event.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
* @return type of event
|
||||
*/
|
||||
public HandlerEvent getEventType()
|
||||
{
|
||||
@@ -141,10 +132,10 @@ public final class StoredAssignedPermissionEvent implements Serializable
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
* Returns the changed permission object.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
* @return changed permission
|
||||
*/
|
||||
public StoredAssignedPermission getPermission()
|
||||
{
|
||||
@@ -153,9 +144,9 @@ public final class StoredAssignedPermissionEvent implements Serializable
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
/** changed permission */
|
||||
private StoredAssignedPermission permission;
|
||||
|
||||
/** Field description */
|
||||
/** type of the event */
|
||||
private HandlerEvent type;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,6 @@ import com.google.inject.Inject;
|
||||
import com.google.inject.Singleton;
|
||||
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.subject.PrincipalCollection;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -325,20 +324,6 @@ public class DefaultSecuritySystem implements SecuritySystem
|
||||
return permissions.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public PrincipalCollection getSystemAccount()
|
||||
{
|
||||
|
||||
// TODO
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user