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 boolean canSetHideList();
public abstract String getDefaultPseud();
public abstract void setDefaultPseud(String val) throws DataException;

View File

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

View File

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