Give more appropriate name to define authorized route for API token
This commit is contained in:
		@@ -21,7 +21,7 @@ impl TokenID {
 | 
			
		||||
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]
 | 
			
		||||
pub struct TokenRight {
 | 
			
		||||
    verb: TokenVerb,
 | 
			
		||||
    uri: String,
 | 
			
		||||
    path: String,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]
 | 
			
		||||
@@ -108,7 +108,7 @@ pub struct NewToken {
 | 
			
		||||
impl TokenRights {
 | 
			
		||||
    pub fn check_error(&self) -> Option<&'static str> {
 | 
			
		||||
        for r in &self.0 {
 | 
			
		||||
            if !r.uri.starts_with("/api/") {
 | 
			
		||||
            if !r.path.starts_with("/api/") {
 | 
			
		||||
                return Some("All API rights shall start with /api/");
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user