Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.coweb.admin.security;
 
 import  javax.ejb.EJB;
 
 
public class SecurityPolicy extends CowebSecurityPolicy {
	private Admin admin;
    public void setAdmin(Admin admin) { 
        this. = admin;
    }

Called when a user preps a session.

Parameters:
username User attempting the prep request
key Conference Key
collab If this conference is collaborative
Returns:
true if the user is allowed to make a prep request.
    public boolean canAdminRequest(String username
            String key
            boolean collab) {
        return this.canSubscribeToSession(usernamekeycollab);
    }
    
    
    
Called when a user attempts to join a session.

Parameters:
username User attempting to join a session.
key Coweb key associated with this session.
collab true is this session is collaborative.
Returns:
true if the user is allowed to join the session.
     public boolean canSubscribeToSession(String usernameString keyboolean collab) {
     	
     	SessionAcls acls = .getSessionAclsForUser(usernamekey);
     	if(acls == null
     		return false;
     	
     	return acls.canAccessSession();
     }
 
   
Called when a user attempts to join a session.

Parameters:
username User attempting to join a session.
sessionid Id of the session
Returns:
true if the user is allowed to join the session.
    public boolean canSubscribeToSession(String usernameString sessionid) {
    	
    	SessionManager manager = SessionManager.getInstance();
    	SessionHandler handler = manager.getSessionHandler(sessionid);
    	
    	return this.canSubscribeToSession(username,
    			handler.getConfKey(),
    			handler.isCollab());
    }
    
    
Called when a user attempts to send a private message to a bot.

Parameters:
username User attempting to make the request.
sessionid Id of the session
serviceName Name of the service the bot provides.
Returns:
true if the user is allowed to make the request.
    public boolean canInvokeServiceRequest(String username
			String sessionid,
			String serviceName) {
    	return true;
    }

    
Called when a user attempts to subscribe to a service bot.

Parameters:
username User attempting to subscribe
sessionid Id of the session
serviceName Name of the service the bot provides.
Returns:
true if the user is allowed to subscribe.
    public boolean canSubscribeService(String username,
			String sessionid,
			String serviceName) {
    	return true;
    }
New to GrepCode? Check out our FAQ X