Zugriff auf eine Forum-Instanz kann jetzt beschränkt werden.
git-svn-id: https://svn.libreccm.org/ccm/trunk@1128 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
b6f6ad9127
commit
596707a5e5
|
|
@ -63,6 +63,7 @@ import com.arsdigita.web.Application;
|
|||
*
|
||||
* @author Kevin Scaldeferri (kevin@arsdigita.com)
|
||||
* @author chrisg23
|
||||
* @author Jens Pelzetter (jensp)
|
||||
* @version $Revision: 1.7 $
|
||||
* @version $Id: Forum.java 1628 2007-09-17 08:10:40Z chrisg23 $
|
||||
*/
|
||||
|
|
@ -70,15 +71,13 @@ public class Forum extends Application {
|
|||
|
||||
/** Private logger instance for debugging purpose */
|
||||
private static final Logger s_log = Logger.getLogger(Forum.class);
|
||||
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.forum.Forum";
|
||||
public static final String PACKAGE_TYPE = "forum";
|
||||
|
||||
public static final String THREAD_SUBSCRIPTION_GROUPS_NAME =
|
||||
"Thread Subscription Groups";
|
||||
|
||||
private static final ForumConfig s_config = new ForumConfig();
|
||||
|
||||
static {
|
||||
s_log.debug("Static initalizer starting...");
|
||||
s_config.load();
|
||||
|
|
@ -88,8 +87,6 @@ public class Forum extends Application {
|
|||
public static ForumConfig getConfig() {
|
||||
return s_config;
|
||||
}
|
||||
|
||||
|
||||
//////
|
||||
//Forum specific privileges
|
||||
/////
|
||||
|
|
@ -111,7 +108,6 @@ public class Forum extends Application {
|
|||
// groups of users for their internal use and to provide private forums
|
||||
// for logged in users only (no public read access).
|
||||
public static final String FORUM_READ_PRIVILEGE = "forum_read";
|
||||
|
||||
///////
|
||||
// pdl forum attribute/association names
|
||||
///////
|
||||
|
|
@ -120,18 +116,17 @@ public class Forum extends Application {
|
|||
private static final String MODERATION = "isModerated";
|
||||
private static final String PUBLIC = "isPublic";
|
||||
private static final String NOTICEBOARD = "isNoticeboard";
|
||||
|
||||
private static final String ADMIN_GROUP = "adminGroup";
|
||||
private static final String MODERATION_GROUP = "moderationGroup";
|
||||
private static final String THREAD_CREATE_GROUP = "threadCreateGroup";
|
||||
private static final String THREAD_RESPONDER_GROUP = "threadRespondGroup";
|
||||
private static final String READ_GROUP = "readGroup";
|
||||
|
||||
private static final String CATEGORY = "category";
|
||||
private static final String EXPIRE_AFTER = "expireAfter";
|
||||
private static final String LIFECYCLE_DEFINITION = "lifecycleDefinition";
|
||||
// additional attributes added chris.gilbert@westsussex.gov.uk
|
||||
private static final String ALLOW_FILE_ATTACHMENTS = "fileAttachmentsAllowed";
|
||||
private static final String ALLOW_FILE_ATTACHMENTS =
|
||||
"fileAttachmentsAllowed";
|
||||
private static final String ALLOW_IMAGE_UPLOADS = "imageUploadsAllowed";
|
||||
private static final String AUTOSUBSCRIBE_THREAD_STARTER =
|
||||
"autoSubscribeThreadStarter";
|
||||
|
|
@ -203,7 +198,8 @@ public class Forum extends Application {
|
|||
Application parent, boolean moderated) {
|
||||
s_log.debug("creating forum " + title);
|
||||
|
||||
Forum forum = (Forum) Application.createApplication(BASE_DATA_OBJECT_TYPE,
|
||||
Forum forum = (Forum) Application.createApplication(
|
||||
BASE_DATA_OBJECT_TYPE,
|
||||
urlName,
|
||||
title, parent, true);
|
||||
|
||||
|
|
@ -237,8 +233,7 @@ public class Forum extends Application {
|
|||
if (category == null) {
|
||||
return createRootCategory();
|
||||
} else {
|
||||
return (Category)DomainObjectFactory
|
||||
.newInstance(category);
|
||||
return (Category) DomainObjectFactory.newInstance(category);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -288,8 +283,8 @@ public class Forum extends Application {
|
|||
// NPE when trying to retrieve sender's email address, thus stopping any
|
||||
// further message processing.
|
||||
// Actually, the only hack involved is making the email address unique.
|
||||
String email = "forum-moderator-" + getID() + "-" +
|
||||
moderators.getID() + "@" + s_config.getReplyHostName();
|
||||
String email = "forum-moderator-" + getID() + "-" + moderators.getID()
|
||||
+ "@" + s_config.getReplyHostName();
|
||||
moderators.setPrimaryEmail(new EmailAddress(email));
|
||||
|
||||
// chris.gilbert@westsussex.gov.uk create additional groups for privilege
|
||||
|
|
@ -340,7 +335,6 @@ public class Forum extends Application {
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
private boolean m_wasNew;
|
||||
|
||||
@Override
|
||||
|
|
@ -426,9 +420,14 @@ public class Forum extends Application {
|
|||
PrivilegeDescriptor.READ,
|
||||
this,
|
||||
getReadGroup()));
|
||||
PermissionService.grantPermission(new PermissionDescriptor(
|
||||
PrivilegeDescriptor.get(FORUM_READ_PRIVILEGE),
|
||||
this,
|
||||
getReadGroup()));
|
||||
}
|
||||
|
||||
KernelExcursion excursion = new KernelExcursion() {
|
||||
|
||||
protected void excurse() {
|
||||
setParty(Kernel.getSystemParty());
|
||||
// FIXME
|
||||
|
|
@ -477,12 +476,12 @@ public class Forum extends Application {
|
|||
return BASE_DATA_OBJECT_TYPE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets all the Subscriptions associated with this Forum.
|
||||
*/
|
||||
public DataCollection getAllSubscriptions() {
|
||||
DataAssociationCursor dac = ((DataAssociation) get(SUBSCRIPTIONS)).cursor();
|
||||
DataAssociationCursor dac = ((DataAssociation) get(SUBSCRIPTIONS)).
|
||||
cursor();
|
||||
return dac;
|
||||
}
|
||||
|
||||
|
|
@ -561,8 +560,7 @@ public class Forum extends Application {
|
|||
public ThreadCollection getThreads(Party party) {
|
||||
ThreadCollection threads = getThreads();
|
||||
|
||||
if (isModerated() &&
|
||||
!canModerate(party)) {
|
||||
if (isModerated() && !canModerate(party)) {
|
||||
s_log.debug("Only showing approved threads");
|
||||
threads.filterUnapproved(party);
|
||||
}
|
||||
|
|
@ -570,14 +568,12 @@ public class Forum extends Application {
|
|||
return threads;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets a ThreadCollection of the threads in a specific Category.
|
||||
*/
|
||||
public ThreadCollection getThreads(BigDecimal categoryID) {
|
||||
|
||||
DataCollection threadsData
|
||||
= SessionManager.getSession().retrieve(
|
||||
DataCollection threadsData = SessionManager.getSession().retrieve(
|
||||
MessageThread.BASE_DATA_OBJECT_TYPE);
|
||||
|
||||
|
||||
|
|
@ -586,11 +582,13 @@ public class Forum extends Application {
|
|||
if (categoryID != null) {
|
||||
// XXX bad dep on ui package
|
||||
if (categoryID.equals(com.arsdigita.forum.ui.Constants.TOPIC_NONE)) {
|
||||
Filter f = threadsData.addNotInSubqueryFilter
|
||||
("root.id", "com.arsdigita.forum.uncategoryObject");
|
||||
Filter f =
|
||||
threadsData.addNotInSubqueryFilter("root.id",
|
||||
"com.arsdigita.forum.uncategoryObject");
|
||||
} else {
|
||||
Filter f = threadsData.addInSubqueryFilter
|
||||
("root.id", "com.arsdigita.forum.categoryObject");
|
||||
Filter f =
|
||||
threadsData.addInSubqueryFilter("root.id",
|
||||
"com.arsdigita.forum.categoryObject");
|
||||
f.set("categoryID", categoryID);
|
||||
}
|
||||
}
|
||||
|
|
@ -609,8 +607,7 @@ public class Forum extends Application {
|
|||
Party party) {
|
||||
ThreadCollection threads = getThreads(categoryID);
|
||||
|
||||
if (isModerated() &&
|
||||
!canModerate(party)) {
|
||||
if (isModerated() && !canModerate(party)) {
|
||||
s_log.debug("Only showing approved threads");
|
||||
threads.filterUnapproved(party);
|
||||
}
|
||||
|
|
@ -631,6 +628,7 @@ public class Forum extends Application {
|
|||
s_log.debug("Creating subscriptions!");
|
||||
|
||||
new KernelExcursion() {
|
||||
|
||||
protected void excurse() {
|
||||
setParty(Kernel.getSystemParty());
|
||||
|
||||
|
|
@ -660,8 +658,8 @@ public class Forum extends Application {
|
|||
*/
|
||||
public DataQuery getCategories() {
|
||||
Session session = SessionManager.getSession();
|
||||
DataQuery query = session.retrieveQuery
|
||||
("com.arsdigita.forum.getCategorizationSummary");
|
||||
DataQuery query = session.retrieveQuery(
|
||||
"com.arsdigita.forum.getCategorizationSummary");
|
||||
query.setParameter("forumID", getID());
|
||||
return query;
|
||||
}
|
||||
|
|
@ -673,8 +671,8 @@ public class Forum extends Application {
|
|||
*/
|
||||
public DataQuery getEmptyCategories() {
|
||||
Session session = SessionManager.getSession();
|
||||
DataQuery query = session.retrieveQuery
|
||||
("com.arsdigita.forum.getUnusedCategories");
|
||||
DataQuery query = session.retrieveQuery(
|
||||
"com.arsdigita.forum.getUnusedCategories");
|
||||
query.setParameter("forumID", getID());
|
||||
return query;
|
||||
}
|
||||
|
|
@ -686,8 +684,8 @@ public class Forum extends Application {
|
|||
*/
|
||||
public DataQuery getUnCategory() {
|
||||
Session session = SessionManager.getSession();
|
||||
DataQuery query = session.retrieveQuery
|
||||
("com.arsdigita.forum.getUncategorizedSummary");
|
||||
DataQuery query = session.retrieveQuery(
|
||||
"com.arsdigita.forum.getUncategorizedSummary");
|
||||
query.setParameter("forumID", getID());
|
||||
return query;
|
||||
}
|
||||
|
|
@ -697,8 +695,9 @@ public class Forum extends Application {
|
|||
DataAssociationCursor cursor =
|
||||
root.getRelatedCategories(Category.CHILD);
|
||||
|
||||
Filter f = cursor.addInSubqueryFilter
|
||||
("id", "com.arsdigita.forum.filledCategories");
|
||||
Filter f =
|
||||
cursor.addInSubqueryFilter("id",
|
||||
"com.arsdigita.forum.filledCategories");
|
||||
return cursor;
|
||||
}
|
||||
|
||||
|
|
@ -721,8 +720,8 @@ public class Forum extends Application {
|
|||
* checks if the user can edit posts in this forum
|
||||
*/
|
||||
public boolean canEdit(Party party) {
|
||||
return (getConfig().canAdminEditPosts() &&
|
||||
PermissionService.checkPermission(
|
||||
return (getConfig().canAdminEditPosts() && PermissionService.
|
||||
checkPermission(
|
||||
new PermissionDescriptor(PrivilegeDescriptor.EDIT,
|
||||
this,
|
||||
party)));
|
||||
|
|
@ -750,14 +749,12 @@ public class Forum extends Application {
|
|||
*/
|
||||
public void setModerated(boolean moderate) {
|
||||
Boolean old = (Boolean) get(MODERATION);
|
||||
if (Boolean.TRUE.equals(old) &&
|
||||
!moderate) {
|
||||
if (Boolean.TRUE.equals(old) && !moderate) {
|
||||
|
||||
DataAssociationCursor posts = getPosts().cursor();
|
||||
posts.addEqualsFilter(Post.STATUS, Post.PENDING);
|
||||
while (posts.next()) {
|
||||
Post post
|
||||
= (Post)DomainObjectFactory.newInstance(
|
||||
Post post = (Post) DomainObjectFactory.newInstance(
|
||||
posts.getDataObject());
|
||||
post.setStatus(Post.APPROVED);
|
||||
post.save();
|
||||
|
|
@ -853,10 +850,11 @@ public class Forum extends Application {
|
|||
// have the same expiration policy.
|
||||
DataAssociationCursor posts = getPosts().cursor();
|
||||
while (posts.next()) {
|
||||
Post post = (Post) DomainObjectFactory.newInstance(posts.getDataObject());
|
||||
if (post.getThread().getRootMessage().getID()
|
||||
.equals(post.getID())) {
|
||||
s_log.debug("Resetting expiration lifecycle for " + post.getOID());
|
||||
Post post = (Post) DomainObjectFactory.newInstance(posts.
|
||||
getDataObject());
|
||||
if (post.getThread().getRootMessage().getID().equals(post.getID())) {
|
||||
s_log.debug("Resetting expiration lifecycle for "
|
||||
+ post.getOID());
|
||||
post.setLifecycle(newLife);
|
||||
}
|
||||
}
|
||||
|
|
@ -944,6 +942,7 @@ public class Forum extends Application {
|
|||
public boolean allowFileAttachments() {
|
||||
return ((Boolean) get(ALLOW_FILE_ATTACHMENTS)).booleanValue();
|
||||
}
|
||||
|
||||
public boolean allowImageUploads() {
|
||||
return ((Boolean) get(ALLOW_IMAGE_UPLOADS)).booleanValue();
|
||||
}
|
||||
|
|
@ -955,6 +954,7 @@ public class Forum extends Application {
|
|||
public boolean noCategoryPostsAllowed() {
|
||||
return ((Boolean) get(NO_CATEGORY_POSTS)).booleanValue();
|
||||
}
|
||||
|
||||
public boolean anonymousPostsAllowed() {
|
||||
return ((Boolean) get(ANONYMOUS_POSTS)).booleanValue();
|
||||
}
|
||||
|
|
@ -962,9 +962,11 @@ public class Forum extends Application {
|
|||
public void setAllowFileAttachments(boolean allow) {
|
||||
set(ALLOW_FILE_ATTACHMENTS, new Boolean(allow));
|
||||
}
|
||||
|
||||
public void setAllowImageUploads(boolean allow) {
|
||||
set(ALLOW_IMAGE_UPLOADS, new Boolean(allow));
|
||||
}
|
||||
|
||||
public void setAutoSubscribeThreadCreator(boolean subscribe) {
|
||||
set(AUTOSUBSCRIBE_THREAD_STARTER, new Boolean(subscribe));
|
||||
}
|
||||
|
|
@ -990,8 +992,8 @@ public class Forum extends Application {
|
|||
|
||||
DataCollection subscriptions = getSubscriptions();
|
||||
while (subscriptions.next()) {
|
||||
ForumSubscription
|
||||
subscription = (ForumSubscription)DomainObjectFactory.
|
||||
ForumSubscription subscription =
|
||||
(ForumSubscription) DomainObjectFactory.
|
||||
newInstance(subscriptions.getDataObject());
|
||||
subscription.getGroup().setName(subscription.getGroupName(this));
|
||||
}
|
||||
|
|
@ -1001,7 +1003,8 @@ public class Forum extends Application {
|
|||
ThreadSubscription threadSub = ThreadSubscription.
|
||||
getThreadSubscription(
|
||||
threads.getMessageThread());
|
||||
threadSub.getGroup().setName(threadSub.getSubscriptionGroupName(this));
|
||||
threadSub.getGroup().setName(threadSub.getSubscriptionGroupName(
|
||||
this));
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1016,7 +1019,6 @@ public class Forum extends Application {
|
|||
// public String getContextPath() {
|
||||
// return "/ccm-forum";
|
||||
// }
|
||||
|
||||
/**
|
||||
* Returns the path name of the location of the applications servlet/JSP.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
*/
|
||||
package com.arsdigita.forum;
|
||||
|
||||
|
||||
import com.arsdigita.forum.portlet.MyForumsPortlet;
|
||||
import com.arsdigita.forum.portlet.RecentPostingsPortlet;
|
||||
import com.arsdigita.kernel.EmailAddress;
|
||||
|
|
@ -38,7 +37,6 @@ import com.arsdigita.web.ApplicationType;
|
|||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
/**
|
||||
* Loader executes nonrecurring at install time and loads (installs and
|
||||
* initializes) the Forum module.
|
||||
|
|
@ -57,6 +55,7 @@ public class Loader extends PackageLoader {
|
|||
|
||||
public void run(final ScriptContext ctx) {
|
||||
new KernelExcursion() {
|
||||
|
||||
public void excurse() {
|
||||
setEffectiveParty(Kernel.getSystemParty());
|
||||
|
||||
|
|
@ -77,23 +76,22 @@ public class Loader extends PackageLoader {
|
|||
* @return
|
||||
*/
|
||||
private static ApplicationType setupForumAppType() {
|
||||
ApplicationType type = ApplicationType
|
||||
.createApplicationType(Forum.PACKAGE_TYPE,
|
||||
ApplicationType type =
|
||||
ApplicationType.createApplicationType(Forum.PACKAGE_TYPE,
|
||||
"Discussion Forum Application",
|
||||
Forum.BASE_DATA_OBJECT_TYPE);
|
||||
type.setDescription("An electronic bulletin board system.");
|
||||
return type;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* TODO: What is it for? Execution is currently commented out.
|
||||
* Referenced class com.arsdigita.forum.Inbox does not exist.
|
||||
* @return
|
||||
*/
|
||||
private static ApplicationType setupInboxAppType() {
|
||||
ApplicationType type = ApplicationType
|
||||
.createApplicationType(Forum.PACKAGE_TYPE,
|
||||
ApplicationType type =
|
||||
ApplicationType.createApplicationType(Forum.PACKAGE_TYPE,
|
||||
"Inbox",
|
||||
"com.arsdigita.forum.Inbox");
|
||||
type.setDescription("Inbox");
|
||||
|
|
@ -105,14 +103,15 @@ public class Loader extends PackageLoader {
|
|||
* @return
|
||||
*/
|
||||
public static AppPortletType setupRecentPostingsPortletType() {
|
||||
AppPortletType type = AppPortletType
|
||||
.createAppPortletType("Recent Forum Postings",
|
||||
AppPortletType type =
|
||||
AppPortletType.createAppPortletType(
|
||||
"Recent Forum Postings",
|
||||
PortletType.WIDE_PROFILE,
|
||||
RecentPostingsPortlet.BASE_DATA_OBJECT_TYPE);
|
||||
type.setProviderApplicationType(Forum.BASE_DATA_OBJECT_TYPE);
|
||||
type.setPortalApplication(true);
|
||||
type.setDescription("Displays the most recent postings " +
|
||||
"to the bulletin board.");
|
||||
type.setDescription("Displays the most recent postings "
|
||||
+ "to the bulletin board.");
|
||||
return type;
|
||||
}
|
||||
|
||||
|
|
@ -122,8 +121,8 @@ public class Loader extends PackageLoader {
|
|||
"My Forums",
|
||||
PortletType.WIDE_PROFILE,
|
||||
MyForumsPortlet.BASE_DATA_OBJECT_TYPE);
|
||||
type.setDescription("Lists forums that user has access to, " + "" +
|
||||
" with last posting date");
|
||||
type.setDescription("Lists forums that user has access to, " + ""
|
||||
+ " with last posting date");
|
||||
|
||||
return type;
|
||||
}
|
||||
|
|
@ -159,22 +158,18 @@ public class Loader extends PackageLoader {
|
|||
*/
|
||||
public static void setupPrivileges() {
|
||||
|
||||
PrivilegeDescriptor.createPrivilege(
|
||||
Forum.FORUM_MODERATION_PRIVILEGE);
|
||||
PrivilegeDescriptor.createPrivilege(
|
||||
Forum.CREATE_THREAD_PRIVILEGE);
|
||||
PrivilegeDescriptor.createPrivilege(
|
||||
Forum.RESPOND_TO_THREAD_PRIVILEGE);
|
||||
PrivilegeDescriptor.createPrivilege(Forum.FORUM_READ_PRIVILEGE);
|
||||
PrivilegeDescriptor.createPrivilege(Forum.FORUM_MODERATION_PRIVILEGE);
|
||||
PrivilegeDescriptor.createPrivilege(Forum.CREATE_THREAD_PRIVILEGE);
|
||||
PrivilegeDescriptor.createPrivilege(Forum.RESPOND_TO_THREAD_PRIVILEGE);
|
||||
// Establich privilege hierarchie, eg. moderation includes createThread
|
||||
PrivilegeDescriptor.addChildPrivilege(
|
||||
Forum.FORUM_MODERATION_PRIVILEGE,
|
||||
PrivilegeDescriptor.addChildPrivilege(Forum.FORUM_MODERATION_PRIVILEGE,
|
||||
Forum.CREATE_THREAD_PRIVILEGE);
|
||||
PrivilegeDescriptor.addChildPrivilege(
|
||||
Forum.CREATE_THREAD_PRIVILEGE,
|
||||
PrivilegeDescriptor.addChildPrivilege(Forum.CREATE_THREAD_PRIVILEGE,
|
||||
Forum.RESPOND_TO_THREAD_PRIVILEGE);
|
||||
PrivilegeDescriptor.addChildPrivilege(
|
||||
Forum.RESPOND_TO_THREAD_PRIVILEGE,
|
||||
PrivilegeDescriptor.addChildPrivilege(Forum.RESPOND_TO_THREAD_PRIVILEGE,
|
||||
PrivilegeDescriptor.READ.getName()); // general read privilege
|
||||
PrivilegeDescriptor.addChildPrivilege(Forum.RESPOND_TO_THREAD_PRIVILEGE,
|
||||
Forum.FORUM_READ_PRIVILEGE);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,13 +55,13 @@ import com.arsdigita.xml.Element;
|
|||
*
|
||||
* @author Kevin Scaldeferri (kevin@arsdigita.com)
|
||||
* @author Chris Gilbert (chrisg23)
|
||||
* @author Jens Pelzetter (jensp)
|
||||
* @version $Revision: 1.3 $ $Author: chrisg23 $ $Date: 2006/03/09 13:48:15 $
|
||||
*/
|
||||
public class ForumUserCompactView extends ModalContainer implements Constants {
|
||||
|
||||
/** Private logger instance for debugging purpose. */
|
||||
private static Logger s_log = Logger.getLogger(ForumUserCompactView.class);
|
||||
|
||||
// Denotes the 6 panels of the user interface, also used as marker to store
|
||||
// and select the active panel
|
||||
/** Denotation of the 'threads' forum mode */
|
||||
|
|
@ -79,7 +79,6 @@ public class ForumUserCompactView extends ModalContainer implements Constants {
|
|||
public static final String MODE_SETUP = "setup";
|
||||
/** Holds the current active mode */
|
||||
private StringParameter m_mode;
|
||||
|
||||
/** Object containing the threads panel (main working panel for users) */
|
||||
private ThreadsPanel m_threadsView;
|
||||
/** Object containing the topics panel */
|
||||
|
|
@ -167,7 +166,8 @@ public class ForumUserCompactView extends ModalContainer implements Constants {
|
|||
Forum forum, String mode) {
|
||||
|
||||
PermissionDescriptor forumAdmin =
|
||||
new PermissionDescriptor(PrivilegeDescriptor.ADMIN, forum, party);
|
||||
new PermissionDescriptor(PrivilegeDescriptor.ADMIN,
|
||||
forum, party);
|
||||
|
||||
PermissionService.assertPermission(forumAdmin);
|
||||
|
||||
|
|
@ -249,13 +249,24 @@ public class ForumUserCompactView extends ModalContainer implements Constants {
|
|||
protected void generateModes(PageState state, Element content,
|
||||
Party party, Forum forum) {
|
||||
|
||||
PermissionDescriptor permission =
|
||||
new PermissionDescriptor(PrivilegeDescriptor.ADMIN, forum, party);
|
||||
PermissionDescriptor permission = new PermissionDescriptor(
|
||||
PrivilegeDescriptor.ADMIN,
|
||||
forum,
|
||||
party);
|
||||
PermissionDescriptor readPermission = new PermissionDescriptor(
|
||||
PrivilegeDescriptor.get(Forum.FORUM_READ_PRIVILEGE),
|
||||
forum,
|
||||
party);
|
||||
|
||||
|
||||
// currently thread panel is always shown. If read access should be
|
||||
// bound to logged in users, additional logic is required here.
|
||||
// jensp 2011-10-02: Additional logic added
|
||||
if (!forum.isPublic()
|
||||
&& PermissionService.checkPermission(readPermission)) {
|
||||
generateModeXML(state, content, MODE_THREADS,
|
||||
Text.gz("forum.ui.modeThreads"));
|
||||
}
|
||||
// topics panel is always shoen as well if not restricted to admins.
|
||||
if (!Forum.getConfig().topicCreationByAdminOnly()) {
|
||||
generateModeXML(state, content, MODE_TOPICS,
|
||||
|
|
@ -348,7 +359,8 @@ public class ForumUserCompactView extends ModalContainer implements Constants {
|
|||
}
|
||||
|
||||
Element content =
|
||||
parent.newChildElement(FORUM_XML_PREFIX + ":forumMode", FORUM_XML_NS);
|
||||
parent.newChildElement(FORUM_XML_PREFIX + ":forumMode",
|
||||
FORUM_XML_NS);
|
||||
|
||||
state.setControlEvent(this, "mode", mode);
|
||||
|
||||
|
|
@ -376,7 +388,4 @@ public class ForumUserCompactView extends ModalContainer implements Constants {
|
|||
current.equals(mode) ? "1" : "0");
|
||||
state.clearControlEvent();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue