Use Decorator to Check User Operating Rights

Suppose we use flask for development, we need to check whether the current user has some operational privileges. from flask import abort from flask_login import current_user from .models import Permission Let's start with the simplest case. f is an operation function, such as adding comments. Then users need Permission.COMMENT to add comments.T ...

Posted on Mon, 19 Aug 2019 07:08:37 -0700 by mazzzzz

2. Spring Security Custom User Authentication Process

Custom landing page: Create a simple login.html landing page under the static folder <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Sign in</title> </head> <body> <h2&g ...

Posted on Mon, 19 Aug 2019 06:59:38 -0700 by wallabee

java basic learning 9(final, Abstract class, interface)

final A class cannot be inherited when the final keyword modifies it A function cannot be overridden when the final keyword modifies it A basic data member variable cannot be modified when the final keyword modifies it A reference type variable cann ...

Posted on Mon, 19 Aug 2019 19:32:32 -0700 by xander85

Java Socket: Network Socket for Pigeon Biography

In ancient times, due to the inconvenience of communication, some smart people made use of the advantages of pigeons flying faster and recognizing directions to domesticate them for the transmission of messages - also known as "pigeon biography".In Java, a network Socket plays the same role. A Socket is an abstraction layer through ...

Posted on Mon, 19 Aug 2019 18:42:11 -0700 by CrazeD

Cookies and localStorage

Distinction and Practice of Local Storage, Cook and Session Storage 1. Cookie cookies. Its size limit is about 4KB, invented by Lou Montulli, a former employee of Netscape in March 1993. Its main purpose is to save login information, such as you can see "remember passwords" when you log into a website market, which is usually achieve ...

Posted on Mon, 19 Aug 2019 20:15:32 -0700 by supinum