there was a problem with security on conf.getHideList()/conf.setHideList() -

added conf.canSetHideList() and some extra code to EditConferenceDialog to
help get around this.
This commit is contained in:
Eric J. Bowersox 2001-11-15 05:13:57 +00:00
parent 0437cc7b92
commit 0750e3f2cd
3 changed files with 32 additions and 5 deletions

View File

@ -102,6 +102,8 @@ public interface ConferenceContext
public abstract void setHideList(boolean flag) throws DataException, AccessError; public abstract void setHideList(boolean flag) throws DataException, AccessError;
public abstract boolean canSetHideList();
public abstract String getDefaultPseud(); public abstract String getDefaultPseud();
public abstract void setDefaultPseud(String val) throws DataException; public abstract void setDefaultPseud(String val) throws DataException;

View File

@ -747,6 +747,12 @@ class ConferenceUserContextImpl implements ConferenceContext, ConferenceBackend
} // end setHideList } // end setHideList
public boolean canSetHideList()
{
return comm.userCanCreateSubobjects();
} // end canSetHideList
public String getDefaultPseud() public String getDefaultPseud()
{ {
return pseud; return pseud;

View File

@ -85,6 +85,17 @@ public class EditConferenceDialog extends ContentDialog
} // end constructor } // end constructor
/*--------------------------------------------------------------------------------
* Internal operations
*--------------------------------------------------------------------------------
*/
private final void doDisable(CommunityContext comm, ConferenceContext conf)
{
setFieldEnabled("hide",conf.canSetHideList());
} // end doDisable
/*-------------------------------------------------------------------------------- /*--------------------------------------------------------------------------------
* External operations * External operations
*-------------------------------------------------------------------------------- *--------------------------------------------------------------------------------
@ -92,15 +103,21 @@ public class EditConferenceDialog extends ContentDialog
public void setupDialog(CommunityContext comm, ConferenceContext conf) throws DataException, AccessError public void setupDialog(CommunityContext comm, ConferenceContext conf) throws DataException, AccessError
{ {
doDisable(comm,conf);
setHiddenField("sig",String.valueOf(comm.getCommunityID())); setHiddenField("sig",String.valueOf(comm.getCommunityID()));
setHiddenField("conf",String.valueOf(conf.getConfID())); setHiddenField("conf",String.valueOf(conf.getConfID()));
setTitle("Edit Conference: " + conf.getName()); setTitle("Edit Conference: " + conf.getName());
setFieldValue("name",conf.getName()); setFieldValue("name",conf.getName());
setFieldValue("descr",conf.getDescription()); setFieldValue("descr",conf.getDescription());
if (conf.canSetHideList())
{ // this is only valid at community level
if (conf.getHideList()) if (conf.getHideList())
setFieldValue("hide",YES); setFieldValue("hide",YES);
else else
setFieldValue("hide",""); setFieldValue("hide","");
} // end if
setFieldValue("read_lvl",String.valueOf(conf.getReadLevel())); setFieldValue("read_lvl",String.valueOf(conf.getReadLevel()));
setFieldValue("post_lvl",String.valueOf(conf.getPostLevel())); setFieldValue("post_lvl",String.valueOf(conf.getPostLevel()));
setFieldValue("create_lvl",String.valueOf(conf.getCreateLevel())); setFieldValue("create_lvl",String.valueOf(conf.getCreateLevel()));
@ -142,6 +159,7 @@ public class EditConferenceDialog extends ContentDialog
// sweep through the conference and set the appropriate changes // sweep through the conference and set the appropriate changes
conf.setName(getFieldValue("name")); conf.setName(getFieldValue("name"));
conf.setDescription(getFieldValue("descr")); conf.setDescription(getFieldValue("descr"));
if (conf.canSetHideList())
conf.setHideList(YES.equals(getFieldValue("hide"))); conf.setHideList(YES.equals(getFieldValue("hide")));
conf.setSecurityLevels(read_lvl,post_lvl,create_lvl,hide_lvl,nuke_lvl,change_lvl,delete_lvl); conf.setSecurityLevels(read_lvl,post_lvl,create_lvl,hide_lvl,nuke_lvl,change_lvl,delete_lvl);
@ -153,6 +171,7 @@ public class EditConferenceDialog extends ContentDialog
public void resetOnError(CommunityContext comm, ConferenceContext conf, String message) public void resetOnError(CommunityContext comm, ConferenceContext conf, String message)
{ {
doDisable(comm,conf);
setHiddenField("sig",String.valueOf(comm.getCommunityID())); setHiddenField("sig",String.valueOf(comm.getCommunityID()));
setHiddenField("conf",String.valueOf(conf.getConfID())); setHiddenField("conf",String.valueOf(conf.getConfID()));
setTitle("Edit Conference: " + conf.getName()); setTitle("Edit Conference: " + conf.getName());