# File permission: assignment

  
The requirements for E-Learn X are:    
  
\- Create capabilities for instructors to manage course readings.  
\- Create a submissions area that allows for assignment uploads without enabling students to view their peers' submissions.  
\- Enable media staging for authors while permitting instructors read-only access.  
\- Confine the use of administrative tools to the system administrators only.    
  
Define User Groups    
  
Create Unix groups corresponding to roles for:    
  
\- instructors  
\- students  
\- content  
\- sysadmins    
  
Then assign system users based on their role in the organization.    
Directory Structure    
An example of a folder structure would be:    
  
text  
/opt/elearn/  
├── course\_materials/  
├── submissions/  
├── content\_staging/  
└── admin\_tools/    
  
Set Ownership and Permissions    
  
Course Materials    
Owner: Instructor(s)    
Group: instructors    
permissions: Instructors can read/write, students can only access the folder.    
  
chown instructor:instructors /opt/elearn/course\_materials    
chmod 2754 /opt/elearn/course\_materials    
  
(setgid) Ensures group ownership is retained by new files.    
(rwx) Owner can read, write,execute.    
(r-x) Group can read, execute.    
(r--): Others (students) can only read.    
  
Owner: root (or instructor)    
Group: students    
Permissions: Students may write, but only to files they can access.

chown root:students /opt/elearn/submissions  
chmod 1773 /opt/elearn/submissions  
  
(sticky bit): Only file owners can delete their files.  
(rwx): Owner can read/write/execute.  
(rwx): Group can read/write/execute.  
(wx): Others can write/upload, but sticky bit prevents deletion of others’ files.

  
Content Staging  
Owner: content-author  
Group: content  
Permissions: Content team members can write, and instructors can read.  
  
chown content-author:content /opt/elearn/content\_staging  
chmod 2750 /opt/elearn/content\_staging  
  
(setgid): Requires group inheritance.  
(rwx): Owner can read, write, and execute.  
(r-x): Group can read and execute.  
(---): Others have no access.  
  
Admin Tools  
Owner: root  
Group: sysadmins  
Permissions: Only sysadmins can access.  
  
chown root:sysadmins /opt/elearn/admin\_tools  
chmod 2770 /opt/elearn/admin\_tools  

(setgid): Group inheritance.  
(rwx): Owner and group have full access.  
(---): Others have no access.  
  
Step 4: Special Permissions  
  
SetGID makes sure new files inherit the group of the directory they are placed in.  
  
The sticky bit on submissions prevents file deletion by students unless they were the ones who created the file.
