mirror of https://github.com/acanas/swad-core.git
Version20.11
This commit is contained in:
parent
982745ffa2
commit
09664664d5
|
@ -553,7 +553,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
|
|||
En OpenSWAD:
|
||||
ps2pdf source.ps destination.pdf
|
||||
*/
|
||||
#define Log_PLATFORM_VERSION "SWAD 20.10.3 (2021-02-07)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 20.11 (2021-02-07)"
|
||||
#define CSS_FILE "swad20.8.css"
|
||||
#define JS_FILE "swad20.6.2.js"
|
||||
/*
|
||||
|
@ -597,11 +597,11 @@ Muchas gracias,.
|
|||
|
||||
Juan Miguel.
|
||||
|
||||
TODO: Fix bug: un profesor editor no puede ver las carpetas de TFG (proyectos) de otros. Debería poder.
|
||||
TODO: DNI de un estudiante sale erróneamente como ******* en lugar de mostrarse al ver los accesos de un estudiante a la asignatura.
|
||||
|
||||
TODO: BUG: Cuando un tipo de grupo sólo tiene un grupo, inscribirse es voluntario, el estudiante sólo puede pertenecer a un grupo, y se inscribe en él, debería poder desapuntarse. Ahora no puede.
|
||||
|
||||
Version 20.11: Feb 07, 2021 An editing teacher can access and modify all files in all projects in course. (304875 lines)
|
||||
Version 20.10.3: Feb 07, 2021 Fixed bug when a teacher changes a student's photo. Reported by Javier Fernández Baldomero. (304871 lines)
|
||||
Version 20.10.2: Feb 02, 2021 Pending password is deleted when used for the first time. (304870 lines)
|
||||
Version 20.10.1: Jan 28, 2021 Exam print returns to the main tab to avoid bug when the student changes the course. (304864 lines)
|
||||
|
|
|
@ -1437,8 +1437,8 @@ static bool Brw_CheckIfICanEditFileOrFolder (unsigned Level);
|
|||
static bool Brw_CheckIfICanCreateIntoFolder (unsigned Level);
|
||||
static bool Brw_CheckIfICanModifySharedFileOrFolder (void);
|
||||
static bool Brw_CheckIfICanModifyPrivateFileOrFolder (void);
|
||||
static bool Brw_CheckIfICanViewProjectDocuments (unsigned MyRolesInProject);
|
||||
static bool Brw_CheckIfICanViewProjectAssessment (unsigned MyRolesInProject);
|
||||
static bool Brw_CheckIfICanViewProjectDocuments (long PrjCod);
|
||||
static bool Brw_CheckIfICanViewProjectAssessment (long PrjCod);
|
||||
static bool Brw_CheckIfICanModifyPrjDocFileOrFolder (void);
|
||||
static bool Brw_CheckIfICanModifyPrjAssFileOrFolder (void);
|
||||
static long Brw_GetPublisherOfSubtree (void);
|
||||
|
@ -3150,7 +3150,6 @@ static void Brw_ShowFileBrowserProject (void)
|
|||
{
|
||||
extern const char *Hlp_ASSESSMENT_Projects;
|
||||
struct Prj_Project Prj;
|
||||
unsigned MyRolesInProject;
|
||||
|
||||
/***** Allocate memory for the project *****/
|
||||
Prj_AllocMemProject (&Prj);
|
||||
|
@ -3168,12 +3167,11 @@ static void Brw_ShowFileBrowserProject (void)
|
|||
Prj_ShowOneUniqueProject (&Prj);
|
||||
|
||||
/***** Show project file browsers *****/
|
||||
MyRolesInProject = Prj_GetMyRolesInProject (Prj_GetPrjCod ());
|
||||
if (Prj_CheckIfICanViewProjectFiles (MyRolesInProject))
|
||||
if (Brw_CheckIfICanViewProjectFiles (Prj.PrjCod))
|
||||
{
|
||||
Brw_WriteTopBeforeShowingFileBrowser ();
|
||||
|
||||
if (Brw_CheckIfICanViewProjectDocuments (MyRolesInProject))
|
||||
if (Brw_CheckIfICanViewProjectDocuments (Prj.PrjCod))
|
||||
{
|
||||
/***** Show the tree with the project documents *****/
|
||||
Gbl.FileBrowser.Type = Brw_ADMI_DOC_PRJ;
|
||||
|
@ -3181,7 +3179,7 @@ static void Brw_ShowFileBrowserProject (void)
|
|||
Brw_ShowFileBrowser ();
|
||||
}
|
||||
|
||||
if (Brw_CheckIfICanViewProjectAssessment (MyRolesInProject))
|
||||
if (Brw_CheckIfICanViewProjectAssessment (Prj.PrjCod))
|
||||
{
|
||||
/***** Show the tree with the project assessment *****/
|
||||
Gbl.FileBrowser.Type = Brw_ADMI_ASS_PRJ;
|
||||
|
@ -11524,17 +11522,42 @@ static bool Brw_CheckIfICanModifyPrivateFileOrFolder (void)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******** Check if I have permission to view project documents zone **********/
|
||||
/******************** Can I view files of a given project? *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static bool Brw_CheckIfICanViewProjectDocuments (unsigned MyRolesInProject)
|
||||
bool Brw_CheckIfICanViewProjectFiles (long PrjCod)
|
||||
{
|
||||
unsigned MyRolesInProject;
|
||||
|
||||
switch (Gbl.Usrs.Me.Role.Logged)
|
||||
{
|
||||
case Rol_STD:
|
||||
case Rol_NET:
|
||||
case Rol_TCH:
|
||||
MyRolesInProject = Prj_GetMyRolesInProject (PrjCod);
|
||||
return (MyRolesInProject != 0); // Am I a member?
|
||||
case Rol_TCH: // Editing teachers in a course can access to all files
|
||||
case Rol_SYS_ADM:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******** Check if I have permission to view project documents zone **********/
|
||||
/*****************************************************************************/
|
||||
|
||||
static bool Brw_CheckIfICanViewProjectDocuments (long PrjCod)
|
||||
{
|
||||
unsigned MyRolesInProject;
|
||||
|
||||
switch (Gbl.Usrs.Me.Role.Logged)
|
||||
{
|
||||
case Rol_STD:
|
||||
case Rol_NET:
|
||||
MyRolesInProject = Prj_GetMyRolesInProject (PrjCod);
|
||||
return (MyRolesInProject != 0); // Am I a member?
|
||||
case Rol_TCH: // Editing teachers in a course can access to all files
|
||||
case Rol_SYS_ADM:
|
||||
return true;
|
||||
default:
|
||||
|
@ -11547,15 +11570,18 @@ static bool Brw_CheckIfICanViewProjectDocuments (unsigned MyRolesInProject)
|
|||
/******** Check if I have permission to view project assessment zone *********/
|
||||
/*****************************************************************************/
|
||||
|
||||
static bool Brw_CheckIfICanViewProjectAssessment (unsigned MyRolesInProject)
|
||||
static bool Brw_CheckIfICanViewProjectAssessment (long PrjCod)
|
||||
{
|
||||
unsigned MyRolesInProject;
|
||||
|
||||
switch (Gbl.Usrs.Me.Role.Logged)
|
||||
{
|
||||
case Rol_STD:
|
||||
case Rol_NET:
|
||||
case Rol_TCH:
|
||||
MyRolesInProject = Prj_GetMyRolesInProject (PrjCod);
|
||||
return ((MyRolesInProject & (1 << Prj_ROLE_TUT | // Tutor...
|
||||
1 << Prj_ROLE_EVL)) != 0); // ...or evaluator
|
||||
case Rol_TCH: // Editing teachers in a course can access to all files
|
||||
case Rol_SYS_ADM:
|
||||
return true;
|
||||
default:
|
||||
|
@ -11580,11 +11606,11 @@ static bool Brw_CheckIfICanModifyPrjDocFileOrFolder (void)
|
|||
{
|
||||
case Rol_STD:
|
||||
case Rol_NET:
|
||||
case Rol_TCH:
|
||||
MyRolesInProject = Prj_GetMyRolesInProject (Prj_GetPrjCod ());
|
||||
if (MyRolesInProject) // I am a member
|
||||
return (Gbl.Usrs.Me.UsrDat.UsrCod == Brw_GetPublisherOfSubtree ()); // Am I the publisher of subtree?
|
||||
return false;
|
||||
case Rol_TCH: // Editing teachers in a course can access to all files
|
||||
case Rol_SYS_ADM:
|
||||
return true;
|
||||
default:
|
||||
|
@ -11609,12 +11635,12 @@ static bool Brw_CheckIfICanModifyPrjAssFileOrFolder (void)
|
|||
{
|
||||
case Rol_STD:
|
||||
case Rol_NET:
|
||||
case Rol_TCH:
|
||||
MyRolesInProject = Prj_GetMyRolesInProject (Prj_GetPrjCod ());
|
||||
if ((MyRolesInProject & (1 << Prj_ROLE_TUT | // Tutor...
|
||||
1 << Prj_ROLE_EVL))) // ...or evaluator
|
||||
return (Gbl.Usrs.Me.UsrDat.UsrCod == Brw_GetPublisherOfSubtree ()); // Am I the publisher of subtree?
|
||||
return false;
|
||||
case Rol_TCH: // Editing teachers in a course can access to all files
|
||||
case Rol_SYS_ADM:
|
||||
return true;
|
||||
default:
|
||||
|
|
|
@ -244,6 +244,8 @@ long Brw_AddPathToDB (long PublisherUsrCod,Brw_FileType_t FileType,
|
|||
const char *FullPathInTree,
|
||||
bool IsPublic,Brw_License_t License);
|
||||
|
||||
bool Brw_CheckIfICanViewProjectFiles (long PrjCod);
|
||||
|
||||
void Brw_RemoveExpiredExpandedFolders (void);
|
||||
|
||||
void Brw_CalcSizeOfDir (char *Path);
|
||||
|
|
|
@ -1230,7 +1230,7 @@ static void Prj_ShowOneProject (struct Prj_Projects *Projects,
|
|||
extern const char *Txt_Required_knowledge;
|
||||
extern const char *Txt_Required_materials;
|
||||
char *Anchor = NULL;
|
||||
bool ICanViewProjectFiles = Prj_CheckIfICanViewProjectFiles (Prj_GetMyRolesInProject (Prj->PrjCod));
|
||||
bool ICanViewProjectFiles = Brw_CheckIfICanViewProjectFiles (Prj->PrjCod);
|
||||
const char *ClassLabel;
|
||||
const char *ClassDate;
|
||||
const char *ClassTitle;
|
||||
|
@ -2795,25 +2795,6 @@ static void Prj_PutFormsToRemEditOnePrj (struct Prj_Projects *Projects,
|
|||
Prj_PutIconOffLockedUnlocked (Prj);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************** Can I view files of a given project? *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
bool Prj_CheckIfICanViewProjectFiles (unsigned MyRolesInProject)
|
||||
{
|
||||
switch (Gbl.Usrs.Me.Role.Logged)
|
||||
{
|
||||
case Rol_STD:
|
||||
case Rol_NET:
|
||||
case Rol_TCH:
|
||||
return (MyRolesInProject != 0); // Am I a member?
|
||||
case Rol_SYS_ADM:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************************ Can I edit a given project? ************************/
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -207,8 +207,6 @@ void Prj_RemStd (void);
|
|||
void Prj_RemTut (void);
|
||||
void Prj_RemEvl (void);
|
||||
|
||||
bool Prj_CheckIfICanViewProjectFiles (unsigned MyRolesInProject);
|
||||
|
||||
void Prj_RequestCreatePrj (void);
|
||||
void Prj_RequestEditPrj (void);
|
||||
|
||||
|
|
Loading…
Reference in New Issue