001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/sections/tags/sakai_2-4-1/sections-api/src/java/org/sakaiproject/section/api/facade/manager/Authz.java $
003: * $Id: Authz.java 19769 2006-12-19 20:49:32Z jholtzman@berkeley.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2005, 2006 The Regents of the University of California and The Regents of the University of Michigan
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.section.api.facade.manager;
021:
022: /**
023: * A facade that provides answers to the section manager's authorization questions.
024: *
025: * @author <a href="mailto:jholtzman@berkeley.edu">Josh Holtzman</a>
026: *
027: */
028: public interface Authz {
029:
030: /**
031: * Returns whether the current user can manage (add, edit, delete) sections.
032: *
033: * @param siteContext
034: * @param userUid The user's uid
035: *
036: * @return
037: */
038: public boolean isSectionManagementAllowed(String userUid,
039: String siteContext);
040:
041: /**
042: * Returns whether the current user can view all sections and their enrollments.
043: *
044: * @param siteContext
045: * @param userUid The user's uid
046: *
047: * @return
048: */
049: public boolean isViewAllSectionsAllowed(String userUid,
050: String siteContext);
051:
052: /**
053: * Returns whether the current user can change section options in the site.
054: *
055: * @param siteContext
056: * @param userUid The user's uid
057: *
058: * @return
059: */
060: public boolean isSectionOptionsManagementAllowed(String userUid,
061: String siteContext);
062:
063: /**
064: * Returns whether the current user can change section enrollments.
065: *
066: * @param siteContext
067: * @param userUid The user's uid
068: *
069: * @return
070: */
071: public boolean isSectionEnrollmentMangementAllowed(String userUid,
072: String siteContext);
073:
074: /**
075: * Returns whether the current user can change TA assignments to sections.
076: *
077: * @param siteContext
078: * @param userUid The user's uid
079: *
080: * @return
081: */
082: public boolean isSectionTaManagementAllowed(String userUid,
083: String siteContext);
084:
085: /**
086: * Returns whether the current user is a student in the course
087: *
088: * @param userUid
089: * @param siteContext
090: * @return
091: */
092: public boolean isViewOwnSectionsAllowed(String userUid,
093: String siteContext);
094:
095: /**
096: * Returns whether the user can be assigned to specific sections. In general, a TA
097: * can be assigned to a section, while an instructor can not (since they are site-wide
098: * administrators).
099: *
100: * @param userUid
101: * @param siteContext
102: * @return
103: */
104: public boolean isSectionAssignable(String userUid,
105: String siteContext);
106:
107: /**
108: * Returns the role description for a user in a particular context. This isn't strictly
109: * authz, but it doesn't seem to require its own facade.
110: *
111: * @param userUid
112: * @param siteContext
113: * @return
114: */
115: public String getRoleDescription(String userUid, String siteContext);
116: }
|