Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.coweb.admin.acls;
  
  public class SessionAcls {
      public final static int SESS_SEE_BIT = 1;
      public final static int SESS_ACCESS_BIT = 2;
      public final static int SESS_CONTROL_BIT = 4;
      public final static int SESS_CHANGE_BIT = 8;
      public final static int SESS_ALL = 15;
  
     // common acl combinations
     public final static int ROLE_UNINVITED = ;
     public final static int ROLE_GUEST = ( | );
     public final static int ROLE_PARTICIPANT = ( | );
     public final static int ROLE_MODERATOR = ( | );
 
     // common descriptions of the privacy of whole sessions
     public final static int SESS_PRIVACY_PRIVATE = 0;
     public final static int SESS_PRIVACY_PUBLIC = 1;
     public final static int SESS_PRIVACY_INVITE = 2;
     public final static int SESS_PRIVACY_CUSTOM = 127;
 
     // common description of the schedule of a session
     // slightly out of place in here
     public final static int SESS_ACTIVITY_ANYTIME = 0;
     public final static int SESS_ACTIVITY_ACTIVE = 1;
 
     private int bits = 0;
 
     public SessionAcls(int bits) {
         this. = bits;
     }

    
Sets all acls.
  
     public void setAll() {
         this. = ;
     }
 
     public int getAcls() {
         return this.;
     }

    
Gets if a user can see session metadata.

Parameters:
value True to set, false to unset, None to leave unchanged
Returns:
True if can view metadata, false if not
 
     public boolean canSeeSession() {
         return valueOf(this. & );
     }
    
    
Gets if a user can see session metadata.

Returns:
True if can view metadata, false if not
 
     public void setSeeSession(boolean value) {
         if(value)
             this. |= ;
         else
             this. &= ~;
     }

    
Gets if a user can access/join this session.

Parameters:
value True to set, false to unset, None to leave unchanged
Returns:
True if can access, false if not
 
     public boolean canAccessSession() {
         return valueOf(this. & );
     }
     
     public void setAccessSession(boolean value) {
     	if(value)
             this. |= ;
         else
             this. &= ~;
     }

    
Gets if a user can control in this session.

Parameters:
value True to set, false to unset, None to leave unchanged
Returns:
True if can control, false if not
 
     public boolean canControlSession(boolean value) {
         if(value)
             this. |= ;
         else
             this. &= ~;
 
         return valueOf(this. & );
     }

    
Gets if a user can change the details of this session.

Parameters:
value True to set, false to unset, None to leave unchanged
Returns:
True if can set, false if not
    public boolean canChangeSession(boolean value) {
        if(value)
            this. |= ;
        else
            this. &= ~;
        return valueOf(this. & );
    }
    
  
    private static boolean valueOf(int i) {
        if(i == 0)
            return false;
        return true;       
    }
New to GrepCode? Check out our FAQ X