Today I want to explore a customisation possibility that is so powerful and still often neglected: customising Sugar’s ACL framework.
The Actions and field visibility part of the ACL in Sugar is normally applied through the use of Roles within the application’s UI, while the visibility of a record is applied through the visibility framework that either allows a user to see a module’s entry or not.
There are two important nuances about Roles in Sugar that I should mention:
Most restrictive prevails, if a user happens to be assigned to more than one Role
Roles do not apply to Sugar Admin type users
The power of the ACL framework is due to the fact that it applies both to the back-end of the system (eg: the API will not allow writes) and to the UI as well by driving buttons and visual screen elements that would allow the user to perform or not the actions.
This project is about driving a two speed fan with an Arduino, based on the environment’s temperature.
The project has been designed to help automating an existing fire-based heating system. The idea is that the environment will be warmed faster, by driving heated air into the room with a multi speed fan, while the fire is hot and the surrounding environment not yet.
I wanted to make it a little more interesting by adding a LCD display to show temperature, humidity and fan status, and four buttons to increase and decrease the two temperature values that drive the fan speeds.
When the temperature is below the lowest temperature threshold, the fan will be running at full speed. With temperatures between the lowest and the highest threshold the fan will be running at half speed and with temperatures above the highest threshold the fan will be off.
This project demonstrates the use of an Arduino (or compatible) micro controller with a temperature and humidity sensor to drive outputs, it demonstrates the usage of a LCD display, push buttons and EEPROM memory storage.
In-memory caching is enabled using memcache/memcached (my current preference) depending on the linux flavour used
Some time ago, I was analysing the performance of the Team Security query. The slowest part of the query seems to be caused by the subquery with joins between the tables team_sets_teams and team_memberships within listview queries.
Then I thought: Sugar caches most of the semi-static data (vardefs, language files, etc) into whatever caching mechanism is used by the system, why don’t we run an IN() condition using the cached list of ids per user, instead of a subquery on every listview load?
This post is supposed to guide through the setup of a VirtualBox virtual machine for local development of Sugar 7.5.x. The OS of choice is Debian 7.8 as it is my personal preference for server setups and it currently fits all the software requirements of Sugar without much additional manual work.
For one of my projects I needed to drive a small motor at different speeds, so I gave this a go by reading and learning more about what is required.
We can achieve that with an Arduino microcontroller by using PWM signals. For this project I am using an Arduino Mini clone, and decided to drive the motor with a N-Channel MOSFET (voltage controlled transistors), activated by a PWM signal.
Keeping the frequency of the signal constant, and varying the width of the “on” time vs the width of the “off” time (changing the duty cycle), will make the motor spin at different speeds.
The signal values that Arduino expects for the duty cycle is from 0 to 255 and it can be set by using the function analogWrite(pin, value). By providing a different duty cycle value to our Arduino pin (in my case PWM pin number 5), the motor will spin at different speed.